[Openswan dev] Compile problems with -Wshadow

Andy fs at globalnetit.com
Wed Apr 26 04:03:51 CEST 2006

Hi guys -

We're using Openswan cross-compiled for the Axis ETRAX CPU, works fine
except that the combination of the Axis development environment
Makefiles and the Openswan Makefiles end up with -Wshadow and -Werror
set by default. It finds several shadow warning situations in the
Openswan sources, so it errors out because of the -Werror.
This is true for all recent versions of Openswan, including 2.4.5 which
I've just started to work with.

I could fix this by dropping the -Wshadow option, of course. But I think
it's nicer to fix the code to remove the shadowed variables.

Would you be interested in patches to fix these? There's not many - I
think it was 5 source files I had to modify in the 2.4.5 tree.

An example is programs/pf_key.c, which declares a global variable
progname, then declares a function Usage() taking a a parameter called
progname. The function doesn't even need the parameter - it can just
refer to the global, which would have been set before Usage() is ever

Andy <fs at globalnetit.com>

More information about the Dev mailing list