On Wed, 2005-05-25 at 09:20 +1000, Benno wrote:
> This will warn about the name of an argument in a function
> *declaration*, shadowing a global.

I try very hard to make the parameter names in the function prototype
match the parameter names in the function definition.  This makes the
Doxygen documentation more useful, and there's less to remember.

Plus one more rule: always include the .h with the interface defintion
in the .c implementing that interface.  This lets the compiler detect
incorrect proptotype vs defintion (i.e. horrendously hard to find bugs).

In the context of the above two paragraphs, the error is not meaningless
when compiling the function definition.  Fixing the function definition
to use a different name (because of -Wshadow) implies changing the
function prototype to match.  Viola, no more "meaningless" warnings.

(BTW: I've stopped using the names "index" and "sin" completely for
variables and parameters.  Mind you, somebody needs to be probed with a
jackhammer as punishment for the stupid names (and tedious shadow
warnings) of the bessel functions: "j0", "j1", "jn", "y0", "y1", and
"yn".)
-- 
Regards
Peter Miller <[EMAIL PROTECTED]>
/\/\*        http://www.canb.auug.org.au/~millerp/

PGP public key ID: 1024D/D0EDB64D
fingerprint = AD0A C5DF C426 4F03 5D53  2BDB 18D8 A4E2 D0ED B64D
See http://www.keyserver.net or any PGP keyserver for public key.

Attachment: signature.asc
Description: This is a digitally signed message part

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to