From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joris van der Hoeven To: help-gcc@gnu.org Subject: Inlining in g++ Date: Fri, 31 Dec 1999 22:24:00 -0000 Message-ID: <199912111517.QAA09113@anh.math.u-psud.fr> X-SW-Source: 1999-12n/msg00167.html Message-ID: <19991231222400.t8NP2r9maSLLHnZmH2NB9VsrgpSr0pUd5kEfy_jeQKY@z> Dear collegue, Is there some way for me to decide that precisely those functions which I declared inline are inlined and no others? When compiling a C++ program using optimization, I have the following problems: - The generated code is not equivalent; my program produces a segmentation fault, while the unoptimized code does not. - Not all functions which have been declared inline are actually inlined. - Some functions which I did not declare inline are inlined. Because of the fact that optimized code is much longer and crashes, I would like to have full control over the inlining process. Ideally speaking, I would appreciate non optimized compilation with all functions declared 'extern inline' being inlined. If there is no way to satisfy my request, maybe you can suggest another solution for the following problem. I have several very elementary data structures like 'array', 'list', 'hashtable', etc... All these classes export a function 'N', which determines the number of elements in the array, list, etc... I declared this function inline for most structures, since it really corresponds to a macro definition pointing to some member. However, for the reasons explained above, the inlining mechanism does not correctly handle this situation. Might there be another way out, like defining a macro which first tests the type of the argument and then expands as a function of the type (very dirty, but this would be satisfactory). Yours, Joris van der Hoeven