On Mon, Aug 20, 2012 at 12:05:20PM +0200, Mark Kettenis wrote:

> Must admit that it's getting a bit of a personal crusade, but I feel
> quite strongly that -Wshadow in its current implementation is useless
> because it whines about local variables shadowing global functions.
> That really never ever signals a programming problem.  And it
> introduces a significant issue because whenever we add a new function
> to one of our headers we suddenly get warnings just because somewhere
> in the tree we have code that happens to use a local variable with the
> same name.  And really, isn't it retarded that I can't have a local
> variable named "index" just because I include <string.h>?

Maybe it's no longer THAT relevant, but index and rindex used to be unix 101
gotcha.

Some systems have switched to strcmp and kept rindex as a macro...
Granted, that's not ISO-compliant, and you can probably get rid of that
with the correct invocation.

But I still would avoid index and rindex like the plague in halfway portable
code.

Reply via email to