From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7842 invoked by alias); 13 Mar 2007 00:19:58 -0000 Received: (qmail 7750 invoked by uid 48); 13 Mar 2007 00:19:48 -0000 Date: Tue, 13 Mar 2007 00:19:00 -0000 Subject: [Bug c++/31158] New: wrong line number in warning: overflow in implicit constant conversion X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "sebor at roguewave dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-03/txt/msg01146.txt.bz2 The line number in the warning below points to the closing brace of the initializer expression making it difficult to find the offending line if the initializer is many lines long. I would like to suggest that the line number be that of the problem line (and perhaps include the column number as well, if possible, when there is more than one initializer per line). $ cat t.cpp && g++ -Wall t.cpp /* 1 */ int main () /* 2 */ { /* 3 */ const struct { short i; } a[] = { /* 4 */ { 65535U }, /* 5 */ { 65536U } /* 6 */ }; /* 7 */ (void)&a; /* 8 */ } /* 9 */ t.cpp: In function 'int main()': t.cpp:6: warning: overflow in implicit constant conversion -- Summary: wrong line number in warning: overflow in implicit constant conversion Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sebor at roguewave dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31158