Hi,

Compiling make-3.79 with a current glibc snapshot.

Autoconfiguration found out that the function 'strsignal' is available.
But the header files declare it only when compiling with -D_GNU_SOURCE.
(Which is ok, because 'strsignal' is by no means a standardized function.)
So we get a warning:

gcc -DALIASPATH=\"/packages/libc6/share/locale:.\" 
-DLOCALEDIR=\"/packages/libc6/share/locale\" -DLIBDIR=\"/packages/libc6/lib\" 
-DINCLUDEDIR=\"/packages/libc6/include\" -DHAVE_CONFIG_H -I. -I.     -O2 -g -Wall -c 
job.c
job.c: In function `child_error':
job.c:263: warning: implicit declaration of function `strsignal'
job.c:264: warning: format argument is not a pointer (arg 4)
job.c: In function `start_job_command':
job.c:866: warning: variable `flags' might be clobbered by `longjmp' or `vfork'
job.c:870: warning: variable `argv' might be clobbered by `longjmp' or `vfork'

And the definition of _GNU_SOURCE in "make.h" comes too late, because at
the point where it is defined, a system header file has already been
included (<sys/types.h> from "gettext.h"). Fix below. In particular,
"make.h" must always be the first file to be included (also because the
AIX pragma alloca).

Also, in the case where strsignal is not defined by the system, but is defined
in signame.c, wouldn't it be appropriate to #include "signame.h" in job.c?

Bruno

*** make-3.79/expand.c.bak      Thu Feb 24 19:57:23 2000
--- make-3.79/expand.c  Wed May  3 01:57:07 2000
***************
*** 17,25 ****
  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */
  
  #include <assert.h>
  
- #include "make.h"
  #include "filedef.h"
  #include "job.h"
  #include "commands.h"
--- 17,26 ----
  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */
  
+ #include "make.h"
+ 
  #include <assert.h>
  
  #include "filedef.h"
  #include "job.h"
  #include "commands.h"
*** make-3.79/file.c.bak        Mon Mar 27 18:20:40 2000
--- make-3.79/file.c    Wed May  3 01:57:16 2000
***************
*** 17,25 ****
  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */
  
  #include <assert.h>
  
- #include "make.h"
  #include "dep.h"
  #include "filedef.h"
  #include "job.h"
--- 17,26 ----
  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */
  
+ #include "make.h"
+ 
  #include <assert.h>
  
  #include "dep.h"
  #include "filedef.h"
  #include "job.h"
*** make-3.79/job.c.bak Thu Feb 24 21:26:25 2000
--- make-3.79/job.c     Wed May  3 01:57:41 2000
***************
*** 17,25 ****
  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */
  
  #include <assert.h>
  
- #include "make.h"
  #include "job.h"
  #include "debug.h"
  #include "filedef.h"
--- 17,26 ----
  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */
  
+ #include "make.h"
+ 
  #include <assert.h>
  
  #include "job.h"
  #include "debug.h"
  #include "filedef.h"
*** make-3.79/make.h.bak        Mon Apr  3 07:45:13 2000
--- make-3.79/make.h    Wed May  3 02:00:43 2000
***************
*** 40,45 ****
--- 40,50 ----
  #endif /* C++ or ANSI C.  */
  
  
+ /* Tell the glibc headers that it should declare strsignal().  */
+ /* This must be defined before any system header file is included.  */
+ #define _GNU_SOURCE 1
+ 
+ 
  #include "gettext.h"
  #define _(Text)     gettext (Text)
  #define N_(Text)    gettext_noop (Text)
***************
*** 60,66 ****
  # define __NO_STRING_INLINES
  #endif
  
- #define _GNU_SOURCE 1
  #include <sys/types.h>
  #include <sys/stat.h>
  #include <signal.h>
--- 65,70 ----

Reply via email to