This is the mail archive of the gcc-bugs@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: Strange CPP failures


On Fri, Jul 12, 2002 at 06:05:35PM +0100, Neil Booth wrote:

 > > #if (+1 - 2) > 0 || (+1U - 2) < 0
 > > # error         /* { dg-bogus "error" }  */
 > > #endif
 > > 
 > > In addition to the combined test, I think it'd be useful to have two
 > > additional tests that check each part separately; it certainly might
 > > help figure out what the failure is.
 > > 
 > > In any case, I'm going to try and start hunting this down today (with
 > > any luck) ... but if you have any advance insight about what the problem
 > > might be before I dive in, I'm all ears :-)
 > 
 > No idea, sorry.  Let me know how you get on.

Well, in this particular case:

#if (+1 - 2) > 0        
# error one
#endif

#if (+1U - 2) < 0
# error two
#endif

...produces:

yeah-baby:thorpej 448$ /usr/local/gnu/bin/gcc -E foo.c 
# 1 "foo.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "foo.c"
foo.c:6:3: #error two
yeah-baby:thorpej 449$ 

...so the result is somehow not ending up as unsigned.

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>


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