From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20423 invoked by alias); 29 Apr 2007 13:58:17 -0000 Received: (qmail 20373 invoked by uid 48); 29 Apr 2007 13:58:07 -0000 Date: Sun, 29 Apr 2007 13:58:00 -0000 Subject: [Bug c++/31757] New: Name arguments in warnings when their names are know X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jg at jguk dot org" 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-04/txt/msg02292.txt.bz2 Could argument names be included in warning messages when they are available? This is the present output: $ g++ -Wall -o t main.cpp main.cpp: In function ‘int main()’: main.cpp:12: warning: passing NULL to non-pointer argument 2 of ‘void f(int, bool, bool, int, unsigned int)’ main.cpp:12: warning: passing NULL to non-pointer argument 3 of ‘void f(int, bool, bool, int, unsigned int)’ The 3rd argument is called "rangetype", so that could be included, to give more context to the user. If the name is available, it could be included, for example as this output: $ g++ -Wall -o t main.cpp main.cpp: In function ‘int main()’: main.cpp:12: warning: passing NULL to non-pointer argument 2 of ‘void f(int, bool, bool, int, unsigned int)’ main.cpp:12: warning: passing NULL to non-pointer argument 3 'rangetype' of ‘void f(int, bool, bool, int, unsigned int)’ Example program: // g++ -Wall -o t main.cpp #include void f(int, bool, bool rangetype, int, unsigned int) { int i = 1; if(rangetype) i =2; } int main() { f(0,NULL,NULL, 1, 1); } -- Summary: Name arguments in warnings when their names are know Product: gcc Version: 4.1.2 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jg at jguk dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31757