standards/97928: fenv.h: fix to compile with gcc > 4.0.
Thierry Thomas
thierry at FreeBSD.org
Thu May 25 13:30:25 PDT 2006
>Number: 97928
>Category: standards
>Synopsis: fenv.h: fix to compile with gcc > 4.0.
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-standards
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Thu May 25 20:30:18 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Thierry Thomas
>Release: FreeBSD 6.1-STABLE i386
>Organization:
Kabbale Eros
>Environment:
System: FreeBSD graf.pompo.net 6.1-STABLE FreeBSD 6.1-STABLE #0: Fri May 12 07:08:06 CEST 2006 thierry at graf.pompo.net:/usr/obj/usr/src/sys/GRAF060511 i386
>Description:
When preparing the next version of ports/french/aster, with MUMPS
support, which requires gfortran and gcc41, I'm stuck with an
error in <fenv.h>:
In file included from inisig.c:108:
/usr/include/fenv.h: In function 'inisig_':
/usr/include/fenv.h:112: error: invalid storage class for function 'feclearexcept'
/usr/include/fenv.h:133: error: invalid storage class for function 'fegetexceptflag'
/usr/include/fenv.h:150: error: invalid storage class for function 'fetestexcept'
/usr/include/fenv.h:163: error: invalid storage class for function 'fegetround'
/usr/include/fenv.h:178: error: invalid storage class for function 'fesetround'
/usr/include/fenv.h:204: error: invalid storage class for function 'fesetenv'
/usr/include/fenv.h:225: error: invalid storage class for function 'fegetexcept'
>How-To-Repeat:
Try to compile something including <fenv.h> with gcc41 (or later).
>Fix:
The following patch, which remove the clause "static", fixes the
problem for me. It should surely be applied to the other
achitectures too, but I have only tested it on i386.
--- fenv.h.diff begins here ---
--- src/lib/msun/i387/fenv.h.orig Thu Mar 17 23:21:46 2005
+++ src/lib/msun/i387/fenv.h Thu May 25 22:04:42 2006
@@ -107,7 +107,7 @@
#define __ldmxcsr(__csr) __asm __volatile("ldmxcsr %0" : : "m" (__csr))
#define __stmxcsr(__csr) __asm __volatile("stmxcsr %0" : "=m" (*(__csr)))
-static __inline int
+__inline int
feclearexcept(int __excepts)
{
fenv_t __env;
@@ -128,7 +128,7 @@
return (0);
}
-static __inline int
+__inline int
fegetexceptflag(fexcept_t *__flagp, int __excepts)
{
int __mxcsr, __status;
@@ -145,7 +145,7 @@
int fesetexceptflag(const fexcept_t *__flagp, int __excepts);
int feraiseexcept(int __excepts);
-static __inline int
+__inline int
fetestexcept(int __excepts)
{
int __mxcsr, __status;
@@ -158,7 +158,7 @@
return ((__status | __mxcsr) & __excepts);
}
-static __inline int
+__inline int
fegetround(void)
{
int __control;
@@ -173,7 +173,7 @@
return (__control & _ROUND_MASK);
}
-static __inline int
+__inline int
fesetround(int __round)
{
int __mxcsr, __control;
@@ -199,7 +199,7 @@
int fegetenv(fenv_t *__envp);
int feholdexcept(fenv_t *__envp);
-static __inline int
+__inline int
fesetenv(const fenv_t *__envp)
{
fenv_t __env = *__envp;
@@ -220,7 +220,7 @@
int feenableexcept(int __mask);
int fedisableexcept(int __mask);
-static __inline int
+__inline int
fegetexcept(void)
{
int __control;
--- fenv.h.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-standards
mailing list