Change most "static inline" functions into "static"?

Derek Atkins warlord at MIT.EDU
Wed Nov 29 09:45:47 EST 2006


Sounds like a good idea to me.

-derek

Christian Stimming <stimming at tuhh.de> writes:

> Someone in IRC reported some problems with gcc-4.1.x and turned-off
> optimization, which disappeared when optimization was turned on (as
> weird as it seems). Apparently, the compiler forgot to generate
> assembler code for some functions that are marked as "static inline" but
> were used through function pointers. Most prominent example here is in
> src/engine/Account.c: on_err(), acc_free(), noop().
>
> Although this is surely a bug on the compiler side, I'd nevertheless
> like to ask whether the "static inline" are correct function attributes
> anyway. If that function is used by a function pointer only, then it
> surely cannot be inlined anyway, and I'd rather suggest changing these
> to "static" only.
>
> I tracked down the introduction of that "static inline". The functions
> itself in src/engine/Account.c were introduced by Linas in
> http://svn.gnucash.org/trac/changeset/9522 in order to clean up the
> xaccAccountCommitEdit function. Linas introduced the
> GNC_COMMIT_EDIT_PART2 macro here and called the functions in that macro.
> When called in a macro, "inline" functions of course make some sense
> because they *can* be inlined. This was merged onto HEAD in 9530.
>
> The COMMIT_EDIT macro call was turned into a function call
> (qof_commit_edit_part2) by chris in
> http://svn.gnucash.org/trac/changeset/13395#file9 which means the
> on_err/acc_free/noop functions were now called through function pointers
> and surely not inlined anymore.
>
> At this point the "inline" doesn't make any more sense.
>
> I suggest to change "static inline" into "static" for all instances
> where a function is used only through function pointers. This mostly
> concerns all the callback functions for qof_commit_edit_part2.
>
> Any objections here?
>
> Christian
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>
>

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list