tech-misc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: argument names in function declarations



On Tue, Aug 25, 2009 at 10:44:37AM -0400, der Mouse wrote:
> >> Does using leading underscores in the names help with the cpp issue?
> > Not really.  Particularly idiotic code and compilers can end up
> > treating the prototype-with-argument-names as a function declaration
> 
> Ummm...isn't that exactly what it is?  Or am I missing something?

The problem is that declarations like:

int foo(int j0);

Fall foul of the "declaration of 'j0' shadows global declaration"
when compiled with -Wshadow (and for the above #include <math.h>).

Perhaps gcc shouldn't be reporting such for parameters in function
declarations.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index