[Bug c/19994] New: warn on parameter name mismatch

2005-02-15 Thread cyeoh at samba dot org
Would like to be able to get a warning when parameter names don't match
the prototype. eg. 

void foo(int x, int y);

then doing

void foo(int y, int x)
{
}

should generate a warning.

-- 
   Summary: warn on parameter name mismatch
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P2
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: cyeoh at samba dot org
CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19994


[Bug c/19994] warn on parameter name mismatch

2005-02-15 Thread cyeoh at samba dot org

--- Additional Comments From cyeoh at samba dot org  2005-02-16 07:05 
---
prototypes in header files can get out of sync with the function definitions (or
parameters are simply get swapped around accidentally) - even with experienced
programmers. 

Users of that interface then get unexpect behaviour. I still think an optional
warning would be useful - and it wouldn't be on by default.

I think it would be fairly unusual that you would want the prototype parameter
names to not match the definition. It wouldn't have to warn if the parameter
names in the prototype were deliberately omitted.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19994