[ODE] Re: configurator patch

Adam D. Moss aspirin at ntlworld.com
Fri Jul 11 09:45:02 2003


Russ Smith wrote:
 >>configurator.c really needs the attached patch (otherwise
 >>'unlink' and 'exit' could be undefined, and this chokes
 >>gcc 3.1).
 >
 >
 > i'm surprised that gcc has a fatal error rather than just an "undefined
 > function" warning, but anyway i've fixed it up this way:
 >
 >   /* include some system header files. <stdio.h> and <stdlib.h> are 
probably
 >    * safe on all systems, but <unistd.h> may not be, so we make explicit
 >    * prototypes for the other functions we need.
 >    */
 >
 >   #include <stdio.h>
 >   #include <stdlib.h>
 >
 >   int unlink (char *pathname);

Interestingly, this fix is still broken on my system:
/tmp/cc7HiJIl.o(.text+0x181): undefined reference to `unlink(char*)'
and still needs <unistd.h>, whereupon all is happy.

I can only assume that unlink() is defined as a macro in unistd.h!
*checks*  Nope, but unistd.h is a strange beast (like all system
headers seem to be nowadays) -- I quote:

extern int unlink (__const char *__name) __THROW;

(but merely interpolating this into configurator.c does not
change matters.)

If this is something very specific to the combination of my
version of glibc and my version of gcc then it's of no
consequence (it's easy enough to fix manually).

--Adam
-- 
Adam D. Moss   . ,,^^   adam@gimp.org   http://www.foxbox.org/   co:3
"When I was young, I would break down and cry whenever mom made me
throw an empty toilet paper tube in the trash can. I just imagined
it sitting at the dump, all cardboard and sad." -- T.Farnon