This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52308] New: -pedantic -ffast-math fails to compile with <cmath>
- From: "DeusExSophismata at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 19 Feb 2012 01:57:30 +0000
- Subject: [Bug c++/52308] New: -pedantic -ffast-math fails to compile with <cmath>
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52308
Bug #: 52308
Summary: -pedantic -ffast-math fails to compile with <cmath>
Classification: Unclassified
Product: gcc
Version: 4.6.2
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: DeusExSophismata@gmail.com
[david@david-desktop ~]$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.6.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin
--enable-java-awt=gtk --disable-dssi
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-ppl --with-cloog --with-tune=generic --with-arch_32=i686
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.6.2 20111027 (Red Hat 4.6.2-1) (GCC)
The following program fails to compile if given the flags -ffast-math
-pedantic.
#include <cmath>
int main () {
return 0;
}
[david@david-desktop ~]$ g++ test.cpp -pedantic -ffast-math
In file included from /usr/include/math.h:423:0,
from
/usr/lib/gcc/x86_64-redhat-linux/4.6.2/../../../../include/c++/4.6.2/cmath:46,
from test.cpp:1:
/usr/include/bits/math-finite.h:25:53: error: declaration of âdouble
acos(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:55:1: error: from previous declaration âdouble
acos(double) throw ()â
/usr/include/bits/math-finite.h:26:53: error: declaration of âfloat
acosf(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:55:1: error: from previous declaration âfloat
acosf(float) throw ()â
/usr/include/bits/math-finite.h:28:65: error: declaration of âlong double
acosl(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:55:1: error: from previous declaration âlong
double acosl(long double) throw ()â
/usr/include/bits/math-finite.h:33:55: error: declaration of âdouble
acosh(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:89:1: error: from previous declaration âdouble
acosh(double) throw ()â
/usr/include/bits/math-finite.h:34:55: error: declaration of âfloat
acoshf(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:89:1: error: from previous declaration âfloat
acoshf(float) throw ()â
/usr/include/bits/math-finite.h:36:67: error: declaration of âlong double
acoshl(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:89:1: error: from previous declaration âlong
double acoshl(long double) throw ()â
/usr/include/bits/math-finite.h:41:53: error: declaration of âdouble
asin(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:57:1: error: from previous declaration âdouble
asin(double) throw ()â
/usr/include/bits/math-finite.h:42:53: error: declaration of âfloat
asinf(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:57:1: error: from previous declaration âfloat
asinf(float) throw ()â
/usr/include/bits/math-finite.h:44:65: error: declaration of âlong double
asinl(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:57:1: error: from previous declaration âlong
double asinl(long double) throw ()â
/usr/include/bits/math-finite.h:48:63: error: declaration of âdouble
atan2(double, double)â has a different exception specifier
/usr/include/bits/mathcalls.h:61:1: error: from previous declaration âdouble
atan2(double, double) throw ()â
/usr/include/bits/math-finite.h:49:62: error: declaration of âfloat
atan2f(float, float)â has a different exception specifier
/usr/include/bits/mathcalls.h:61:1: error: from previous declaration âfloat
atan2f(float, float) throw ()â
/usr/include/bits/math-finite.h:51:80: error: declaration of âlong double
atan2l(long double, long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:61:1: error: from previous declaration âlong
double atan2l(long double, long double) throw ()â
/usr/include/bits/math-finite.h:56:55: error: declaration of âdouble
atanh(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:93:1: error: from previous declaration âdouble
atanh(double) throw ()â
/usr/include/bits/math-finite.h:57:55: error: declaration of âfloat
atanhf(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:93:1: error: from previous declaration âfloat
atanhf(float) throw ()â
/usr/include/bits/math-finite.h:59:67: error: declaration of âlong double
atanhl(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:93:1: error: from previous declaration âlong
double atanhl(long double) throw ()â
/usr/include/bits/math-finite.h:64:53: error: declaration of âdouble
cosh(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:73:1: error: from previous declaration âdouble
cosh(double) throw ()â
/usr/include/bits/math-finite.h:65:53: error: declaration of âfloat
coshf(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:73:1: error: from previous declaration âfloat
coshf(float) throw ()â
/usr/include/bits/math-finite.h:67:65: error: declaration of âlong double
coshl(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:73:1: error: from previous declaration âlong
double coshl(long double) throw ()â
/usr/include/bits/math-finite.h:71:51: error: declaration of âdouble
exp(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:101:1: error: from previous declaration âdouble
exp(double) throw ()â
/usr/include/bits/math-finite.h:72:51: error: declaration of âfloat
expf(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:101:1: error: from previous declaration âfloat
expf(float) throw ()â
/usr/include/bits/math-finite.h:74:63: error: declaration of âlong double
expl(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:101:1: error: from previous declaration âlong
double expl(long double) throw ()â
/usr/include/bits/math-finite.h:79:55: error: declaration of âdouble
exp10(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:122:1: error: from previous declaration âdouble
exp10(double) throw ()â
/usr/include/bits/math-finite.h:80:55: error: declaration of âfloat
exp10f(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:122:1: error: from previous declaration âfloat
exp10f(float) throw ()â
/usr/include/bits/math-finite.h:82:67: error: declaration of âlong double
exp10l(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:122:1: error: from previous declaration âlong
double exp10l(long double) throw ()â
/usr/include/bits/math-finite.h:86:55: error: declaration of âdouble
pow10(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:124:1: error: from previous declaration âdouble
pow10(double) throw ()â
/usr/include/bits/math-finite.h:87:55: error: declaration of âfloat
pow10f(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:124:1: error: from previous declaration âfloat
pow10f(float) throw ()â
/usr/include/bits/math-finite.h:89:67: error: declaration of âlong double
pow10l(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:124:1: error: from previous declaration âlong
double pow10l(long double) throw ()â
/usr/include/bits/math-finite.h:95:53: error: declaration of âdouble
exp2(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:143:1: error: from previous declaration âdouble
exp2(double) throw ()â
/usr/include/bits/math-finite.h:96:53: error: declaration of âfloat
exp2f(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:143:1: error: from previous declaration âfloat
exp2f(float) throw ()â
/usr/include/bits/math-finite.h:98:65: error: declaration of âlong double
exp2l(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:143:1: error: from previous declaration âlong
double exp2l(long double) throw ()â
/usr/include/bits/math-finite.h:103:61: error: declaration of âdouble
fmod(double, double)â has a different exception specifier
/usr/include/bits/mathcalls.h:189:1: error: from previous declaration âdouble
fmod(double, double) throw ()â
/usr/include/bits/math-finite.h:104:60: error: declaration of âfloat
fmodf(float, float)â has a different exception specifier
/usr/include/bits/mathcalls.h:189:1: error: from previous declaration âfloat
fmodf(float, float) throw ()â
/usr/include/bits/math-finite.h:106:78: error: declaration of âlong double
fmodl(long double, long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:189:1: error: from previous declaration âlong
double fmodl(long double, long double) throw ()â
/usr/include/bits/math-finite.h:111:63: error: declaration of âdouble
hypot(double, double)â has a different exception specifier
/usr/include/bits/mathcalls.h:164:1: error: from previous declaration âdouble
hypot(double, double) throw ()â
/usr/include/bits/math-finite.h:112:62: error: declaration of âfloat
hypotf(float, float)â has a different exception specifier
/usr/include/bits/mathcalls.h:164:1: error: from previous declaration âfloat
hypotf(float, float) throw ()â
/usr/include/bits/math-finite.h:114:80: error: declaration of âlong double
hypotl(long double, long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:164:1: error: from previous declaration âlong
double hypotl(long double, long double) throw ()â
/usr/include/bits/math-finite.h:120:49: error: declaration of âdouble
j0(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:239:1: error: from previous declaration âdouble
j0(double) throw ()â
/usr/include/bits/math-finite.h:121:49: error: declaration of âfloat
j0f(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:239:1: error: from previous declaration âfloat
j0f(float) throw ()â
/usr/include/bits/math-finite.h:123:61: error: declaration of âlong double
j0l(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:239:1: error: from previous declaration âlong
double j0l(long double) throw ()â
/usr/include/bits/math-finite.h:127:49: error: declaration of âdouble
y0(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:242:1: error: from previous declaration âdouble
y0(double) throw ()â
/usr/include/bits/math-finite.h:128:49: error: declaration of âfloat
y0f(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:242:1: error: from previous declaration âfloat
y0f(float) throw ()â
/usr/include/bits/math-finite.h:130:61: error: declaration of âlong double
y0l(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:242:1: error: from previous declaration âlong
double y0l(long double) throw ()â
/usr/include/bits/math-finite.h:134:49: error: declaration of âdouble
j1(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:240:1: error: from previous declaration âdouble
j1(double) throw ()â
/usr/include/bits/math-finite.h:135:49: error: declaration of âfloat
j1f(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:240:1: error: from previous declaration âfloat
j1f(float) throw ()â
/usr/include/bits/math-finite.h:137:61: error: declaration of âlong double
j1l(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:240:1: error: from previous declaration âlong
double j1l(long double) throw ()â
/usr/include/bits/math-finite.h:141:49: error: declaration of âdouble
y1(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:243:1: error: from previous declaration âdouble
y1(double) throw ()â
/usr/include/bits/math-finite.h:142:49: error: declaration of âfloat
y1f(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:243:1: error: from previous declaration âfloat
y1f(float) throw ()â
/usr/include/bits/math-finite.h:144:61: error: declaration of âlong double
y1l(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:243:1: error: from previous declaration âlong
double y1l(long double) throw ()â
/usr/include/bits/math-finite.h:148:54: error: declaration of âdouble jn(int,
double)â has a different exception specifier
/usr/include/bits/mathcalls.h:241:1: error: from previous declaration âdouble
jn(int, double) throw ()â
/usr/include/bits/math-finite.h:149:54: error: declaration of âfloat jnf(int,
float)â has a different exception specifier
/usr/include/bits/mathcalls.h:241:1: error: from previous declaration âfloat
jnf(int, float) throw ()â
/usr/include/bits/math-finite.h:151:66: error: declaration of âlong double
jnl(int, long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:241:1: error: from previous declaration âlong
double jnl(int, long double) throw ()â
/usr/include/bits/math-finite.h:155:54: error: declaration of âdouble yn(int,
double)â has a different exception specifier
/usr/include/bits/mathcalls.h:244:1: error: from previous declaration âdouble
yn(int, double) throw ()â
/usr/include/bits/math-finite.h:156:54: error: declaration of âfloat ynf(int,
float)â has a different exception specifier
/usr/include/bits/mathcalls.h:244:1: error: from previous declaration âfloat
ynf(int, float) throw ()â
/usr/include/bits/math-finite.h:158:66: error: declaration of âlong double
ynl(int, long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:244:1: error: from previous declaration âlong
double ynl(int, long double) throw ()â
/usr/include/bits/math-finite.h:164:68: error: declaration of âdouble
lgamma_r(double, int*)â has a different exception specifier
/usr/include/bits/mathcalls.h:273:1: error: from previous declaration âdouble
lgamma_r(double, int*) throw ()â
/usr/include/bits/math-finite.h:165:68: error: declaration of âfloat
lgammaf_r(float, int*)â has a different exception specifier
/usr/include/bits/mathcalls.h:273:1: error: from previous declaration âfloat
lgammaf_r(float, int*) throw ()â
/usr/include/bits/math-finite.h:167:80: error: declaration of âlong double
lgammal_r(long double, int*)â has a different exception specifier
/usr/include/bits/mathcalls.h:273:1: error: from previous declaration âlong
double lgammal_r(long double, int*) throw ()â
/usr/include/bits/math-finite.h: In function âdouble lgamma(double)â:
/usr/include/bits/math-finite.h:173:49: error: declaration of âdouble
lgamma(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:253:1: error: from previous declaration âdouble
lgamma(double) throw ()â
/usr/include/bits/math-finite.h:182:48: error: declaration of âfloat
lgammaf(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:253:1: error: from previous declaration âfloat
lgammaf(float) throw ()â
/usr/include/bits/math-finite.h:192:60: error: declaration of âlong double
lgammal(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:253:1: error: from previous declaration âlong
double lgammal(long double) throw ()â
/usr/include/bits/math-finite.h:206:48: error: declaration of âdouble
gamma(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:266:1: error: from previous declaration âdouble
gamma(double) throw ()â
/usr/include/bits/math-finite.h:215:47: error: declaration of âfloat
gammaf(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:266:1: error: from previous declaration âfloat
gammaf(float) throw ()â
/usr/include/bits/math-finite.h:225:59: error: declaration of âlong double
gammal(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:266:1: error: from previous declaration âlong
double gammal(long double) throw ()â
/usr/include/bits/math-finite.h: At global scope:
/usr/include/bits/math-finite.h:238:51: error: declaration of âdouble
log(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:110:1: error: from previous declaration âdouble
log(double) throw ()â
/usr/include/bits/math-finite.h:239:51: error: declaration of âfloat
logf(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:110:1: error: from previous declaration âfloat
logf(float) throw ()â
/usr/include/bits/math-finite.h:241:63: error: declaration of âlong double
logl(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:110:1: error: from previous declaration âlong
double logl(long double) throw ()â
/usr/include/bits/math-finite.h:245:55: error: declaration of âdouble
log10(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:113:1: error: from previous declaration âdouble
log10(double) throw ()â
/usr/include/bits/math-finite.h:246:55: error: declaration of âfloat
log10f(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:113:1: error: from previous declaration âfloat
log10f(float) throw ()â
/usr/include/bits/math-finite.h:248:67: error: declaration of âlong double
log10l(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:113:1: error: from previous declaration âlong
double log10l(long double) throw ()â
/usr/include/bits/math-finite.h:253:53: error: declaration of âdouble
log2(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:146:1: error: from previous declaration âdouble
log2(double) throw ()â
/usr/include/bits/math-finite.h:254:53: error: declaration of âfloat
log2f(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:146:1: error: from previous declaration âfloat
log2f(float) throw ()â
/usr/include/bits/math-finite.h:256:65: error: declaration of âlong double
log2l(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:146:1: error: from previous declaration âlong
double log2l(long double) throw ()â
/usr/include/bits/math-finite.h:261:59: error: declaration of âdouble
pow(double, double)â has a different exception specifier
/usr/include/bits/mathcalls.h:155:1: error: from previous declaration âdouble
pow(double, double) throw ()â
/usr/include/bits/math-finite.h:262:58: error: declaration of âfloat
powf(float, float)â has a different exception specifier
/usr/include/bits/mathcalls.h:155:1: error: from previous declaration âfloat
powf(float, float) throw ()â
/usr/include/bits/math-finite.h:264:76: error: declaration of âlong double
powl(long double, long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:155:1: error: from previous declaration âlong
double powl(long double, long double) throw ()â
/usr/include/bits/math-finite.h:268:71: error: declaration of âdouble
remainder(double, double)â has a different exception specifier
/usr/include/bits/mathcalls.h:290:1: error: from previous declaration âdouble
remainder(double, double) throw ()â
/usr/include/bits/math-finite.h:269:70: error: declaration of âfloat
remainderf(float, float)â has a different exception specifier
/usr/include/bits/mathcalls.h:290:1: error: from previous declaration âfloat
remainderf(float, float) throw ()â
/usr/include/bits/math-finite.h:271:88: error: declaration of âlong double
remainderl(long double, long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:290:1: error: from previous declaration âlong
double remainderl(long double, long double) throw ()â
/usr/include/bits/math-finite.h:276:63: error: declaration of âdouble
scalb(double, double)â has a different exception specifier
/usr/include/bits/mathcalls.h:365:1: error: from previous declaration âdouble
scalb(double, double) throw ()â
/usr/include/bits/math-finite.h:277:62: error: declaration of âfloat
scalbf(float, float)â has a different exception specifier
/usr/include/bits/mathcalls.h:365:1: error: from previous declaration âfloat
scalbf(float, float) throw ()â
/usr/include/bits/math-finite.h:279:80: error: declaration of âlong double
scalbl(long double, long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:365:1: error: from previous declaration âlong
double scalbl(long double, long double) throw ()â
/usr/include/bits/math-finite.h:284:53: error: declaration of âdouble
sinh(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:75:1: error: from previous declaration âdouble
sinh(double) throw ()â
/usr/include/bits/math-finite.h:285:53: error: declaration of âfloat
sinhf(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:75:1: error: from previous declaration âfloat
sinhf(float) throw ()â
/usr/include/bits/math-finite.h:287:65: error: declaration of âlong double
sinhl(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:75:1: error: from previous declaration âlong
double sinhl(long double) throw ()â
/usr/include/bits/math-finite.h:291:53: error: declaration of âdouble
sqrt(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:158:1: error: from previous declaration âdouble
sqrt(double) throw ()â
/usr/include/bits/math-finite.h:292:53: error: declaration of âfloat
sqrtf(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:158:1: error: from previous declaration âfloat
sqrtf(float) throw ()â
/usr/include/bits/math-finite.h:294:65: error: declaration of âlong double
sqrtl(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:158:1: error: from previous declaration âlong
double sqrtl(long double) throw ()â
/usr/include/bits/math-finite.h: In function âdouble tgamma(double)â:
/usr/include/bits/math-finite.h:300:49: error: declaration of âdouble
tgamma(double)â has a different exception specifier
/usr/include/bits/mathcalls.h:260:1: error: from previous declaration âdouble
tgamma(double) throw ()â
/usr/include/bits/math-finite.h: In function âfloat tgammaf(float)â:
/usr/include/bits/math-finite.h:307:48: error: declaration of âfloat
tgammaf(float)â has a different exception specifier
/usr/include/bits/mathcalls.h:260:1: error: from previous declaration âfloat
tgammaf(float) throw ()â
/usr/include/bits/math-finite.h: In function âlong double tgammal(long
double)â:
/usr/include/bits/math-finite.h:315:60: error: declaration of âlong double
tgammal(long double)â has a different exception specifier
/usr/include/bits/mathcalls.h:260:1: error: from previous declaration âlong
double tgammal(long double) throw ()â