bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: isinf and type-pun warning/error on OSF guile 1.8.7


From: Jay K
Subject: RE: isinf and type-pun warning/error on OSF guile 1.8.7
Date: Wed, 9 Jun 2010 23:16:28 +0000

Andy, I will try it later.
 
Often what autoconf does is:
 
echo "int main() {  isinf(0); }"> conftest.c
gcc conftest.c
 => if it links successfully, it is there.
 
 
and then later on the "real" code uses gcc -Wmissing-prototypes -Werror, boom.
That's what I saw months/year+ ago on Irix at least.
I think in the Irix case the protype was under an #if.
I'll look around more on Tru64. Might get the admin to install newer 
compiler/headers too.
 
 
 
You know, every so often I get up the gumption to try gcc/make check, which 
requires a whole bunch more stuff than just gcc/make ... bdwgc, guile, 
libunistring, autogen, tcl, dejagnu, expect, pkg-config, ffi....kind of 
annoying, oh well. It looks like I succeeded this time, phew..
 
 
Thanks, later,
 - Jay



----------------------------------------
> From: address@hidden
> To: address@hidden
> CC: address@hidden
> Subject: Re: isinf and type-pun warning/error on OSF guile 1.8.7
> Date: Thu, 10 Jun 2010 00:28:00 +0200
>
> Hi Jay,
>
> On Wed 09 Jun 2010 17:43, Jay K writes:
>
>> libtool: compile: gcc -DHAVE_CONFIG_H -I.. -I/home/jayk/src/guile-1.8.7 -I.. 
>> -mieee -mieee -D_REENTRANT -pthread -g -O2 -Wall -Wmissing-prototypes 
>> -Werror -MT libguile_la-numbers.lo -MD -MP -MF .deps/libguile_la-numbers.Tpo 
>> -c /home/jayk/src/guile-1.8.7/libguile/numbers.c -DPIC -o 
>> .libs/libguile_la-numbers.o
>> cc1: warnings being treated as errors
>> /home/jayk/src/guile-1.8.7/libguile/numbers.c: In function 'xisinf':
>> /home/jayk/src/guile-1.8.7/libguile/numbers.c:144: error: implicit
>> declaration of function 'isinf'
>
>> I couldn't find isinf in any header.
>
> This call only occurs if configure detected support `isinf', so surely
> it is there? Can you check again? Barring that can you send a
> config.log, please.
>
>> /home/jayk/src/guile-1.8.7/libguile/numbers.c: In function 'guile_ieee_init':
>> /home/jayk/src/guile-1.8.7/libguile/numbers.c:623: error: dereferencing 
>> type-punned pointer will break strict-aliasing rules
>> /home/jayk/src/guile-1.8.7/libguile/numbers.c:654: error: dereferencing 
>> type-punned pointer will break strict-aliasing rules
>
> Does replacing that DINIFINITY block with the following help?
>
> /* OSF */
> extern unsigned int DINFINITY[2];
> union
> {
> double d;
> int i[2];
> } alias;
> alias.i[0] = DINFINITY[0];
> alias.i[1] = DINFINITY[1];
> guile_Inf = alias.d;
>
> Likewise for DQNAN:
>
> {
> /* OSF */
> extern unsigned int DQNAN[2];
> union
> {
> double d;
> int i[2];
> } alias;
> alias.i[0] = DQNAN[0];
> alias.i[1] = DQNAN[1];
> guile_NaN = alias.d;
> }
>
>> I recall seeing the same problem on Irix, where autoconf does a link check
>> and compiles without -Wmissing-prototype so it passes, because the function
>> does exist somewhere. Autoconf checks need to more closely resemble
>> how later compilation will occur.
>
> How does that work though -- does isinf have no header/declaration?
>
>> /home/jayk/src/guile-1.8.7/test-suite/standalone/test-conversion.c:859:
>> error: dereferencing type-punned pointer will break strict-aliasing
>> rules make[4]: *** [test_conversion-test-conversion.o] Error 1
>
> We can copy the above solution if it works. Let us know!
>
> Andy
> --
> http://wingolog.org/                                    


reply via email to

[Prev in Thread] Current Thread [Next in Thread]