Subject: Re: Compiling NetBSD with another compiler.
To: None <tech-userlevel@netbsd.org>
From: Aleksey Cheusov <cheusov@tut.by>
List: tech-userlevel
Date: 10/13/2007 18:03:28
> On Sat, Oct 13, 2007 at 05:33:02PM +0300, Aleksey Cheusov wrote:
>> > Why should I have to go through my perfectly legitimate, legal C
>> > program and change all references to the member of my struct that I
>> > named "stat" just because the system headers wanted to rename a
>> > function?
>> Just because you ALREADY do this for many years. Actually EVERY macro
>> definition in system headers is a BAD NAME.
> The difference is that such MACROS are spelled in upper case.
Run the following on your system
find /usr/obj/destdir/usr/include -type f |
xargs egrep 'define[[:space:]]*[[:lower:]][[:lower:]_]+' |
wc -l
>> So, the system headers ALREADY contain tons of bad names.
>> My suggestion ('#define stat stat_new' for "all other" compilers)
>> just adds some new "bad names" to the existing big pile,
>> NOT CREATE A NEW ONE.
> Yes, it certainly creates a huge new pile. Those names are were
> explictly reserved for functions.
Yes, I know there are such functions.
> E.g. read SUS and find that you have to provide a prototype for
> stat(2) and fgetc(2).
Not a big problem.
99.99% doesn't depend on whether stat(2) is function of a macro.
> Note that the headers are allowed to define a
> macro for fgetc, but you can undefine it if you really want to use
> it e.g. as member of a struct.
fgetc doesn't need renaming.
> The list of allowed macros with lower
> case names is quite small.
really :)
See above
--
Best regards, Aleksey Cheusov.