Created attachment 28966 [details] Preprocessed source I'm trying to build spandsp using musl libc and found that sqrt() & pow() compilation is broken when using <tgmath.h> with gcc-4.8, but no errors with gcc-4.2.4. Preprocessed source are the same using both gcc versions (can be found in the attached file). According to the one of the musl developers, it can be related to the "tgmath __RETCAST magic" http://www.openwall.com/lists/musl/2012/12/14/6 musl's tgmath.h source can be found at http://git.musl-libc.org/cgit/musl/tree/include/tgmath.h /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libxml2 -DNDEBUG -msse2 -Wunused-but-set-variable -std=gnu99 -ffast-math -Wall -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -DHAVE_VISIBILITY=1 -pedantic -MT awgn.lo -MD -MP -MF .deps/awgn.Tpo -c -o awgn.lo awgn.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libxml2 -DNDEBUG -msse2 -Wunused-but-set-variable -std=gnu99 -ffast-math -Wall -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -DHAVE_VISIBILITY=1 -pedantic -MT awgn.lo -MD -MP -MF .deps/awgn.Tpo -c awgn.c -fPIC -DPIC -o .libs/awgn.o awgn.c: In function 'awgn_init_dbov': awgn.c:109:5: error: void value not ignored as it ought to be s->rms = pow(10.0, level/20.0)*32768.0; ^ awgn.c: In function 'awgn': awgn.c:165:9: error: void value not ignored as it ought to be fac = sqrt(-2.0*log(r)/r); ^ awgn.c:165:9: error: void value not ignored as it ought to be awgn.c:165:9: error: void value not ignored as it ought to be awgn.c:165:9: error: void value not ignored as it ought to be Please tell me if any other info is needed.
Created attachment 28967 [details] Kinda reduced testcase
Created attachment 28970 [details] Correct kinda reduced testcase oops, testcase hasn't actually shown the issue. Just confirmed that the issue also exist with glibc/x86_64 [gcc (GCC) 4.8.0 20121209 (experimental), last snapshot]
I think one of the typeof is being chosen as a void* and then we take another typeof of the deferenced version of that. This is what is causing the "void value not ignored as it ought to be".
Bisection told me that a75b1c712f1eaddc69919461ead67f4ac21663fe is the first bad commit commit a75b1c712f1eaddc69919461ead67f4ac21663fe Author: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Sun Mar 29 18:13:43 2009 +0000 PR c/456 PR c/5675 PR c/19976 PR c/29116 PR c/31871 PR c/35198 … git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145254 138bc75d-0d04-0410-961f-82ee72b054a4 Adding author to CC.
Closing per http://www.openwall.com/lists/musl/2012/12/18/6