This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
making library calls inline w/ and w/o optimization ebabled
- From: "Aaron Case" <aaron dot case at dynazign dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Thu, 28 Aug 2003 10:45:06 -0400
- Subject: making library calls inline w/ and w/o optimization ebabled
Hello,
I am porting code from MSVC v5.1 to gcc.
The application code contains the pragma directive intrinsic as such.
#pragma intrinsic(memset)
This, as expected, is not recognized with GCC as it does not contain this
pragma directive(see warning below).
xyztask.c:56: warning: ignoring #pragma intrinsic
GCC does however have an attribute __always_inline, and says this in the
manual.
always_inline
Generally, functions are not inlined unless optimization is specified. For
functions declared inline, this attribute inlines the function even if no
optimization level was specified.
However, memset is a library function. So if the optimization is turned off
and I declare it as inline and apply this attribute the compiler will
compile the code in-line.
Since this is a library function how do you force the compiler to make it
inline(redeclare, overload...?), or does GCC have a mechanism to force
inline compilation of library calls.
Thanks in advance
Aaron