From: Yann Dirson Date: Thu, 17 Jan 2008 23:18:35 +0000 (+0100) Subject: Do not attempt to outguess system headers by (re)defining errno. X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=5d0aa931eb2fe22d99277b0fbf998b4fa18f4231;hp=f1233c24bb1ad5c8b0971c4bc35404c4d6ca503b;p=gnushogi.git Do not attempt to outguess system headers by (re)defining errno. Recent glibc define error as a cpp macro expanding to a function call. Thus, "extern int errno" should cause a link-time undefined symbol when errno.h is not included. Here it is, and gcc complains with the following cryptic warning: ../../gnushogi/sysdeps.c: In function 'ElapsedTime_FIONREAD': ../../gnushogi/sysdeps.c:97: warning: function declaration isn't a prototype --- diff --git a/gnushogi/sysdeps.c b/gnushogi/sysdeps.c index c1e43cf..a8f8bd4 100644 --- a/gnushogi/sysdeps.c +++ b/gnushogi/sysdeps.c @@ -91,7 +91,6 @@ ElapsedTime_FIONREAD(ElapsedTime_mode iop) int nchar; struct timeval tv; - extern int errno; if ((i = ioctl((int) 0, FIONREAD, &nchar))) { @@ -227,9 +226,6 @@ ElapsedTime_FIONREAD(ElapsedTime_mode iop) int nchar; int i; - extern int errno; - - if ((i = ioctl((int) 0, FIONREAD, &nchar))) { perror("FIONREAD");