This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: More front end type mismatch problems



On May 27, 2005, at 11:05 AM, Diego Novillo wrote:


This is happening in gcc.dg/tree-ssa/20040121-1.c.  The test
specifically tests that (p!=0) + (q!=0) should be computed as
int:

char *foo(char *p, char *q) {
    int x = (p !=0) + (q != 0);
    ...
}

Is this program legal C?

!= is defined to produce an int result in C. This is valid, and may produce a result of 0, 1, or 2.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]