Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 May 2006 14:10:22 GMT
From:      Rostislav Krasny <rosti.bsd@gmail.com>
To:        freebsd-standards@FreeBSD.org
Subject:   Re: standards/97928: fenv.h: fix to compile with gcc > 4.0.
Message-ID:  <200605271410.k4REAMNh041583@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR standards/97928; it has been noted by GNATS.

From: Rostislav Krasny <rosti.bsd@gmail.com>
To: Thierry Thomas <thierry@FreeBSD.org>
Cc: bug-followup@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);
  



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605271410.k4REAMNh041583>