This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
fixinc: svr4_ftw and _STYPES: huh?
- From: neroden at twcny dot rr dot com (Nathanael Nerode)
- To: bkorb at veritas dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 12 Aug 2003 17:15:14 -0400
- Subject: fixinc: svr4_ftw and _STYPES: huh?
This hack (present also in fixinc.svr4) has a clear motivation listed:
to avoid a definition of something as 'extern' and then as 'static'.
But the fix itself contains a very unclear element: the curious use of
'_STYPES'. Do you (or anyone) have any idea at all why it is checking
whether _STYPES is defined?
I'm thinking of making this another one of the 'enabled only for svr4,
because I can't figure out what it's supposed to be doing' hacks.
(DYNIX/ptx, the only svr4 system anyone's volunteered to test for
me, apparently doesn't have the problem declarations.)
> sed = '/^extern int ftw(const/i' "\\\n"
> "#if !defined(_STYPES)\\\n"
> "static\\\n"
> "#else\\\n"
> "extern\\\n"
> "#endif";
> sed = 's/extern \(int ftw(const.*\)$/\1/';
> sed = "/^extern int nftw/i\\\n"
> "#if defined(_STYPES)\\\n"
> "static\\\n"
> "#else\\\n"
> "extern\\\n"
> "#endif";
> sed = 's/extern \(int nftw.*\)$/\1/';
> sed = "/^extern int ftw(),/c\\\n"
> "#if !defined(_STYPES)\\\n"
> "static\\\n"
> "#else\\\n"
> "extern\\\n"
> "#endif\\\n"
> " int ftw();\\\n"
> "#if defined(_STYPES)\\\n"
> "static\\\n"
> "#else\\\n"
> "extern\\\n"
> "#endif\\\n"
> " int nftw();";
--
Nathanael Nerode <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html