Jonathan Lennox - Re: PATCH RFC: -Wstrict-overflow, take 2 (original) (raw)
This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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] |
- From: Jonathan Lennox
- To: Ian Lance Taylor
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 16 Feb 2007 17:15:13 -0500
- Subject: Re: PATCH RFC: -Wstrict-overflow, take 2
- References: <m3hctwgi1d.fsf@localhost.localdomain> <17878.7709.414766.597566@metro-north.cs.columbia.edu> <m3mz3ddc9q.fsf@localhost.localdomain>
On February 16 2007, "Ian Lance Taylor" wrote to "Jonathan Lennox, gcc-patches@gcc.gnu.org" saying:
Jonathan Lennox lennox@cs.columbia.edu writes:
How hard would it be to change this diagnostic to print the actual values of "X", "+-", "C1", "cmp", and "C2"?
For expmed.c:3485, for example, the warning would be
../../trunk/gcc/expmed.c:3485: warning: assuming signed overflow does not occur when changing "size - 1 < 32" to "size < 32 + 1"
I think this would be much more accessible to people not versed in the intricacies of compilers, and also make it much easier (as in this case) to see at a glance if signed overflow could actually be a problem.
Well, the X can, in general, be anything. As far as I know we don't have a good way to dump general expressions in warning contexts. But maybe I just don't know about it.
The C1 and C2 are integer constants, and would be easy to dump. It's line 8296 of fold-const.c. Go for it.
The tricky points are that a) fold_overflow_warning doesn't take a formatting string, and b) I don't have a GCC copyright assignment, and my current work situation would make it non-trivial to acquire one.
I could file an enhancement request PR, I suppose.
-- Jonathan Lennox lennox at cs dot columbia dot edu
- References:
- PATCH RFC: -Wstrict-overflow, take 2
* From: Ian Lance Taylor - Re: PATCH RFC: -Wstrict-overflow, take 2
* From: Jonathan Lennox - Re: PATCH RFC: -Wstrict-overflow, take 2
* From: Ian Lance Taylor
- PATCH RFC: -Wstrict-overflow, take 2
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |