c/8236: turning on optimization breaks preprocessor output

neil@gcc.gnu.org neil@gcc.gnu.org
Tue Oct 15 15:22:00 GMT 2002


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



More information about the Gcc-bugs mailing list