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 at gcc dot gnu dot org
- To: 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
- Date: 15 Oct 2002 22:22:27 -0000
- Subject: Re: c/8236: turning on optimization breaks preprocessor output
- Reply-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
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)
and this extra level of indirection will work provided
you use my_strncmp instead. Of course, this may introduce
other issues.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8236