c/8236: turning on optimization breaks preprocessor output

Neil Booth neil@daikokuya.co.uk
Tue Oct 15 15:24:00 GMT 2002

neil@gcc.gnu.org wrote:-

> Synopsis: turning on optimization breaks preprocessor output
> State-Changed-From-To: open->closed
> State-Changed-By: neil
> State-Changed-When: Tue Oct 15 15:22:27 2002
> State-Changed-Why:
>     Not a bug.  Macro arguments are determined before arguments
>     are macro-expanded.  Glibc has a "feature" whereby if you
>     specify optimization to GCC, it "optimizes" various library
>     calls by making them into macros.
>     It is quite entitled to do this, and so the bug is in your
>     code.
>     You can work around it by defining a macro
>     #define my_strncmp(a, b, n) strncmp (a, b, n)

Bah, make that

#define my_strncmp(a, b) strncmp (a, b)


More information about the Gcc-bugs mailing list