src/bin/ed/re.c: warning: declaration of `exp' shadows a global declaration

David O'Brien obrien at FreeBSD.ORG
Mon Jul 21 10:13:06 PDT 2003

On Tue, Jul 15, 2003 at 07:59:43AM +0200, Harti Brandt wrote:
> On Tue, 15 Jul 2003, Jun Kuriyama wrote:
> JK>With new gcc and -Wshadow, src/bin/ed/re.c shows this warning:
> JK>
> JK>cc -Wshadow -c re.c
> JK>re.c: In function `get_compiled_pattern':
> JK>re.c:44: warning: declaration of `exp' shadows a global declaration
> JK><built-in>:0: warning: shadowed declaration is here
> JK>
> JK>It seems local variable exp is conflicted with exp(3) declaration.  I
> JK>don't know what name should be used...
> I would call this a compiler bug. It shouldn't declare exp(3) when you
> don't include math.h. As I understand the standard the names in math.h are
> only reserved when you include math.h. I remember that an earlier version
> of gcc had this bug, that was fixed then. Probably they unfixed it again.
> What's the chance of getting this fixed?

There is a discussion on the gcc-patches at mailing list, but
they are having a hard time agreeing there is a bug here.  FreeBSD's GCC
problems have a better chance of getting fixed if those that experience
and understand the bug would participate in related discussions on the
GCC mailing lists.  The Linux and Solaris community has no problem doing
this -- for some reason the BSD communities expects the poor guy doing
the GCC imports to be the single voice for BSD. :-(

-- David    (obrien at

More information about the freebsd-current mailing list