This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/2098: compare with unsigned variable - no error reporting
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c/2098: compare with unsigned variable - no error reporting
- From: jochen dot pernsteiner at stud dot fh-regensburg dot de
- Date: 26 Feb 2001 12:13:40 -0000
- Reply-To: jochen dot pernsteiner at stud dot fh-regensburg dot de
>Number: 2098
>Category: c
>Synopsis: compare with unsigned variable - no error reporting
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Feb 26 04:16:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: jochen.pernsteiner@stud.fh-regensburg.de
>Release: 2.95.2
>Organization:
>Environment:
linux i586
>Description:
If a unsigned (not signed!) variable is compared with immediate
value which is outside the range of the variable, gcc does not
report an error. ("-Wall" does not help)
Example:
int main()
{
unsigned char c;
if (c==10000) return 1;
else return 0;
}
If c is made signed, an error is reported.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: