fixinc: svr4_ftw and _STYPES: huh?
Nathanael Nerode
neroden@twcny.rr.com
Tue Aug 12 21:45:00 GMT 2003
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
More information about the Gcc
mailing list