pending/5051: May I ask a C Language problem?

rodrigc@gcc.gnu.org rodrigc@gcc.gnu.org
Sat Dec 8 19:04:00 GMT 2001


Synopsis: May I ask a C Language problem?

State-Changed-From-To: open->closed
State-Changed-By: rodrigc
State-Changed-When: Sat Dec  8 19:04:06 2001
State-Changed-Why:
    Not a bug.
    If I compile your code with:
    gcc -Wall -pedantic test.c
    
    r.c:8: warning: operation on `x' may be undefined
    
    If I compile with the Digital Unix C++ compiler,
    I get a larger warning:
    
    cc: Warning: test.c, line 8: In this statement, the expression "printf(...)" modifies the variable "x" more than once without an intervening sequence point.  This behavior is undefined. (undefvarmod)
      printf ("%d\n", a (x));
    
    What you are doing is undefined, so can differ between
    compilers.
    
    This is not a bug in gcc.  Post your general C language questions
    to the newsgroup comp.lang.c.moderated

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=5051&database=gcc



More information about the Gcc-prs mailing list