This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/8236: turning on optimization breaks preprocessor output
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: neil at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org,meshko at scorch2000 dot com, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
- Date: Tue, 15 Oct 2002 23:24:42 +0100
- Subject: Re: c/8236: turning on optimization breaks preprocessor output
- References: <20021015222227.1423.qmail@sources.redhat.com>
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)
Neil.