standards/97928: fenv.h: fix to compile with gcc > 4.0.

Rostislav Krasny rosti.bsd at gmail.com
Sat May 27 07:10:37 PDT 2006


The following reply was made to PR standards/97928; it has been noted by GNATS.

From: Rostislav Krasny <rosti.bsd at gmail.com>
To: Thierry Thomas <thierry at FreeBSD.org>
Cc: bug-followup at FreeBSD.org
Subject: Re: standards/97928: fenv.h: fix to compile with gcc > 4.0.
Date: Sat, 27 May 2006 16:54:21 +0300

 Hi,
 
 > >How-To-Repeat:
 > 	Try to compile something including <fenv.h> with gcc41 (or later).
 
 Any regular program with fenv.h compiles without any problem. However
 running 'gcc41 -c inisig.c -DP_LINUX' reproduces the problem. That made
 me interested. After some searching on the web I've found that this is
 because in GCC 4.1 and newer "function prototype declarations in nested
 scopes are no longer accepted". So this is aster's bug. Try following
 patch:
 
 --- inisig.c.orig	Thu Dec 22 09:51:16 2005
 +++ inisig.c	Sat May 27 16:34:05 2006
 @@ -51,6 +51,11 @@
    void stptrap(int sig);
  #endif
  
 +#ifdef P_LINUX
 +#define _GNU_SOURCE 1
 +#include <fenv.h>
 +#endif
 +
  #ifdef CRAY
    void INISIG( void )
  #elif defined SOLARIS || IRIX || P_LINUX || TRU64 || SOLARIS64 
 @@ -103,8 +108,6 @@
  
  #elif defined P_LINUX
  
 -#define _GNU_SOURCE 1
 -#include <fenv.h>
     /* Enable some exceptions. At startup all exceptions are masked. */
     feenableexcept(FE_DIVBYZERO|FE_OVERFLOW);
  


More information about the freebsd-standards mailing list