Abdelrazak Younes wrote: > Jean-Marc Lasgouttes wrote: >>>>>>> "Abdelrazak" == Abdelrazak Younes >>>>>>> <[EMAIL PROTECTED]> writes: >> Abdelrazak> By the way, 'insetlatexaccent.h' uses the same syntax: >> >> Abdelrazak> inline bool canDisplay(); >> >> Abdelrazak> Don't you have a warning for this one? >> >> No, because this one is defined later in the header file. This is >> different from putting it in the .C file only. > > From a compiler POV, this should not matter really.
It matters a lot. During the compile, the compiler sees only what is in the .h file. It does not know at all in which .C file the code of only declared functions is, so it can't inline it. If that would at all be possible the compiler would need the help of the linker, because only at linking time the function body is known. Then the linker could tell the compiler where the functin is defined, and the compiler could recompile all code that uses the function with the inlined version. I guess it is obvious why this is not in the standard. >> It does link, but I do not like the warnings. I even suspect that it >> may not be inlined, but I am not sure what a weak symbol is: I knew that once, but forgot. I am 100% sure that this does not get inlined. MSVC probably does not warn about that because "inline" is only a hint to the compiler. The compiler is free to ignore that hint. Georg, whos holidays are over and who has therefore very little spare time again.