bug in src/shared.c
Simon Josefsson
simon at josefsson.org
Tue Jan 13 18:04:09 CET 2009
Stefan Janssen <stefan.janssen at uni-bielefeld.de> writes:
> Simon Josefsson wrote:
>> Stefan Janssen <stefan.janssen at uni-bielefeld.de> writes:
>>
>>
>>> Hi,
>>>
>>> I tried to compile gnuTLS on my Solaris SunOS 5.10 i386 machine. Make
>>> crashed, because in the file src/shared.c in line 727 the symbol
>>> HUGE_VAL is used twice. After I added Parentesis behind HUGE_VAL
>>> everything compiled fine. Maybe you could change this line in your
>>> source from
>>>
>>> if (double_val == +HUGE_VAL || double_val == -HUGE_VAL)
>>>
>>> to
>>>
>>> if (double_val == +HUGE_VAL() || double_val == -HUGE_VAL())
>>>
>>
>> Hi. Thanks for the report. Which gcc version do you use? We've seen
>> this before, and then it was a gcc bug:
>>
> $> gcc --version
> gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
> Copyright (C) 2004 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> PURPOSE.
Then you'll need the patch in:
http://gcc.gnu.org/ml/gcc-patches/2005-05/msg02123.html
Or just upgrade to a more recent gcc.
>> http://thread.gmane.org/gmane.comp.encryption.gpg.gnutls.devel/2495/focus=2933
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19933
>>
>> Changing the code the way you proposed will break on many platforms, so
>> it is not an option:
>>
>> cfg/shared.c:727: error: called object ‘+Inf’ is not a function
>>
>> Does either of the suggested fix in the thread above solve the problem
>> for you?
>>
> The trick with with the redefinition #define HUGE_VAL
> (__builtin_huge_val()) seems to work, but it produces the following
> warnings:
>
> $> gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I../includes
> -I../includes -I../lgl -I../lgl -I../gl -I../gl -I./cfg
> -I/vol/pi/include -I/opt/csw/include -I/usr/sfw/include
> -I/usr/X11/include -I/vol/pi/include -g -O2 -MT shared.o -MD -MP -MF
> .deps/shared.Tpo -c -o
> shared.o `test -f 'cfg/shared.c' || echo './'`cfg/shared.c
>
> cfg/shared.c:61:1: warning: "HUGE_VAL" redefined
> In file included from
> /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/include/math.h:27,
> from cfg/shared.c:43:
> /usr/include/iso/math_c99.h:27:1: warning: this is the location of the
> previous definition
>
>
> If I remove the -std=gnu99 flag, but don't change the code, everything
> seems to work fine: (I don't get any respond on STDERR or STDOUT)
>
> $> gcc -DHAVE_CONFIG_H -I. -I.. -I../includes -I../includes -I../lgl
> -I../lgl -I../gl -I../gl -I./cfg -I/vol/pi/include -I/opt/csw/include
> -I/usr/sfw/include -I/usr/X11/include -I/vol/pi/include -g -O2 -MT
> shared.o -MD -MP -MF .deps/shared.Tpo -c -o shared.o `test -f
> 'cfg/shared.c' || echo './'`cfg/shared.c
Thanks for testing, hopefully having this in the mailing list archive
will help others running into the same problem.
/Simon
More information about the Gnutls-devel
mailing list