On Sun, 15 Jan 2006 10:07:50 +1300, Ian <ia******@hotmail.com> wrote
in comp.lang.c:
This is partly related to the kernel C/C++ thread, one thing I'm not
sure about with modern C compiler is how aggressively they inline
trivial functions as an optimisation.
A C++ compiler will be fairly aggressive in this area, so it is
generally safe to assume that short functions will get inlined away as
this tends to improve both code size and execution speed.
Do modern C compilers do the same?
First, please use a proper signature delimiter, like mine at the
bottom. It consists of "-- ". Most newsreaders recognize this and
provide proper handling automatically.
Second, what is your definition of "modern C compilers"? Optimization
is both inherently implementation specific, and not defined by the C
standard. If you want to know about the behavior of specific
compilers, as in their compiler specific support groups or try them
yourself.
Note that compilers that support the 1999 or later versions of the C
standard recognize the inline keyword to specifically suggest to the
compiler that you want a particular function inlined. Just as with
the register keyword, the compiler is free to ignore your request.
--
Jack Klein
Home:
http://JK-Technology.Com
FAQs for
comp.lang.c
http://c-faq.com/
comp.lang.c++
http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html