This is the mail archive of the gcc-patches@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]

[patch] libcpp fix div overflow


For the simple case of:

#if (-1)/2
#endif

we'll give an overflow warning for the expression. I'm pretty sure we don't want to do this, just as we wouldn't if someone used this in an enum or the result of a multiply in a preprocessor expression. So we should check to see whether or not our result is zero first (just like we do for multiply and others).

For some reason I thought that there was a bugzilla on this, but now I can't find it.

OK for mainline?

-eric

2007-05-01 Eric Christopher <echristo@apple.com>

	* expr.c (num_div_op): Don't overflow if the result is
	zero.


Attachment: libcpp.diff.txt
Description: Text document


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