This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/62059] New: signed integer overflow in diagnostic.c adjust_line
- From: "zeccav at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 08 Aug 2014 08:10:01 +0000
- Subject: [Bug c/62059] New: signed integer overflow in diagnostic.c adjust_line
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62059
Bug ID: 62059
Summary: signed integer overflow in diagnostic.c adjust_line
Product: gcc
Version: 4.9.1
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: zeccav at gmail dot com
Created attachment 33272
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33272&action=edit
Used by test case
// gcc 4.9.1
// ../../gcc-4.9.1/gcc/diagnostic.c:274:42: runtime error: signed integer
overflow: 2147483646 - -4 cannot be represented in type 'int'
// installparse.l is a one line file containing "%{%}" I am attaching it anyway
// offending instruction in diagnostic.c function adjust_line is
// right_margin = max_width - right_margin;
// where max_width==INT_MAX and right_margin is negative (here is -4)
# 1 "installparse.l"
static foo(void);
void bar(void)
{
foo();
}
I am attaching installparse.l