[torquedev] Re: trunk not compiiing on OS X 10.4
Garrick Staples
garrick at usc.edu
Wed Aug 29 09:22:30 MDT 2007
On Wed, Aug 29, 2007 at 11:09:46AM -0400, Glen Beane alleged:
> On 8/29/07, Garrick Staples <garrick at usc.edu> wrote:
> > On Wed, Aug 29, 2007 at 10:23:44AM -0400, Glen Beane alleged:
> > > On 8/29/07, Glen Beane <glen.beane at gmail.com> wrote:
> > > > the use of HUGE_VAL causes a warning "floating constant exceeds range
> > > > of 'double'"
> > > >
> > > > thse files have not changed in quite some time. any ideas? I haven't
> > > > tried to compile torque on OS X for a while since I've been working
> > > > primarilly in Linux.
> > > >
> > > >
> > > > gcc version 4.0.1 (Apple Computer, Inc. build 5341)
> > > >
> > > >
> > > >
> > > >
> > > > ../Libdis/disp10d_.c: In function 'disp10d_':
> > > > ../Libdis/disp10d_.c:107: warning: floating constant exceeds range of 'double'
> > > > ../Libdis/disp10d_.c:115: warning: floating constant exceeds range of 'double'
> > > > make[3]: *** [disp10d_.lo] Error 1
> > > > make[3]: *** Waiting for unfinished jobs....
> > > > cc1: warnings being treated as errors
> > > > ../Libdis/disp10l_.c: In function 'disp10l_':
> > > > ../Libdis/disp10l_.c:135: warning: floating constant exceeds range of 'double'
> > > > ../Libdis/disp10l_.c:158: warning: floating constant exceeds range of 'double'
> > > > make[3]: *** [disp10l_.lo] Error 1
> > > > make[2]: *** [all-recursive] Error 1
> > > > make[1]: *** [all-recursive] Error 1
> > > > make: *** [all-recursive] Error 1
> > > >
> > >
> > >
> > > I can reproduce this with a very tiny C progra:
> > >
> > >
> > > mightymac:/tmp gbeane$ cat test.c
> > > #include <math.h>
> > >
> > > int main (int argc, char **argv)
> > > {
> > > double x = HUGE_VAL;
> > >
> > > return 0;
> > > }
> > > mightymac:/tmp gbeane$ gcc -pedantic test.c
> > > test.c: In function 'main':
> > > test.c:5: warning: floating constant exceeds range of 'double'
> > > mightymac:/tmp gbeane$ gcc test.c
> > > mightymac:/tmp gbeane$
> > >
> > >
> > >
> > > It seems to me like a bug in the version of gcc on my Mac. I think a
> > > near term solution is to not compile anything with HUGE_VAL with
> > > -pedantic
> >
> > It would seem to me that if HUGE_VAL doesn't fit in a double, then the compiler
> > or header files are definitely broken.
> >
> > What does 'gcc -E' give you for that file? I get:
> >
> > int main (int argc, char **argv)
> > {
> > double x = (__builtin_huge_val());
> >
> > return 0;
> > }
>
> I get
>
> int main (int argc, char **argv)
> {
> double x = 1e500;
>
> return 0;
> }
Well, that about hits the limit of my knowledge :)
Maybe one of the -std=XX gcc flags? I don't really know.
But I do know that gcc 4.0 is buggy and we probably shouldn't spend too much time working around it. Does apple have another compiler available? ( they certainly didn't build their OS with gcc4.0)
>
> I also discovered that bindresvport is not declared in netinet/in.h on
> my Mac so Libnet does not compile:
>
> ./Libnet/net_client.c:259: warning: implicit declaration of function
> 'bindresvport'
>
>
> even though the man page says it is declared in netinet/in.h
>
> mightymac:/tmp/trunk gbeane$ grep bindresvport /usr/include/netinet/*
> mightymac:/tmp/trunk gbeane$
>
>
> my linux box:
>
> gbeane at wulfgar:~> grep bindresvport /usr/include/netinet/*
> /usr/include/netinet/in.h:extern int bindresvport (int __sockfd,
> struct sockaddr_in *__sock_in) __THROW;
> /usr/include/netinet/in.h:extern int bindresvport6 (int __sockfd,
> struct sockaddr_in6 *__sock_in)
Can't find it declared anywhere else?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.supercluster.org/pipermail/torquedev/attachments/20070829/160e48e7/attachment-0001.bin
More information about the torquedev
mailing list