NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: lib/55310: implicit conversion error when compiling current amd64 with clang
The following reply was made to PR lib/55310; it has been noted by GNATS.
From: Rares Aioanei <bsdlisten%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: lib-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
netbsd-bugs%netbsd.org@localhost
Subject: Re: lib/55310: implicit conversion error when compiling current
amd64 with clang
Date: Thu, 28 May 2020 11:25:41 +0300
On Thu, May 28, 2020 at 07:55:00AM +0000, rares.aioanei%gmail.com@localhost wrote:
> >Number: 55310
> >Category: lib
> >Synopsis: implicit conversion error when compiling current amd64 with clang
> >Confidential: no
> >Severity: serious
> >Priority: medium
> >Responsible: lib-bug-people
> >State: open
> >Class: sw-bug
> >Submitter-Id: net
> >Arrival-Date: Thu May 28 07:55:00 +0000 2020
> >Originator: Rares Aioanei
> >Release: CURRENT
> >Organization:
> >Environment:
> n/a
> >Description:
> This happens when cross-compiling on FreeBSD 12.1-RELEASE amd64 as well as on my NetBSD CURRENT amd64 box, using clang exactly as instructed in the docs, by altering mk.conf :
>
> # compile libntp/timexsup.o
> /stpool/devel/netbsd/current/amd64/usr/src/obj/tooldir.FreeBSD-12.1-RELEASE-p3-amd64/bin/x86_64--netbsd-clang -O2 -std=gnu99 -Wno-sign-compare -Wno-pointer-sign -Wall -Wstrict-prototyp
> es -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare -Wsign-compare -Wform
> at=2 -Wpointer-sign -Wmissing-noreturn -Werror -Wno-missing-noreturn -Wno-unneeded-internal-declaration -Wno-parentheses -Wno-constant-logical-operand -Wno-error=unused-const-variable
> -fPIE --sysroot=/stpool/devel/netbsd/current/amd64/usr/src/obj/destdir.amd64 -DHAVE_CONFIG_H -I/stpool/devel/netbsd/current/amd64/usr/src/external/bsd/ntp/include -I/stpool/devel/netbsd/
> current/amd64/usr/src/external/bsd/ntp/dist/include -I/stpool/devel/netbsd/current/amd64/usr/src/external/bsd/ntp/dist/lib/isc/include -I/stpool/devel/netbsd/current/amd64/usr/src/external
> /bsd/ntp/dist/lib/isc/unix/include -I/stpool/devel/netbsd/current/amd64/usr/src/external/bsd/ntp/dist/lib/isc/nothreads/include -DOPENSSL -DAUTOKEY -DUSE_OPENSSL_CRYPTO_RAND -DWANT_IPV6 -I/
> stpool/devel/netbsd/current/amd64/usr/src/external/bsd/ntp/dist/sntp/libopts -c /stpool/devel/netbsd/current/amd64/usr/src/external/bsd/ntp/dist/libntp/timexsup.c -o timexsup.o
> /stpool/devel/netbsd/current/amd64/usr/src/external/bsd/ntp/dist/libntp/timexsup.c:33:14: error: implicit conversion from 'long' to 'double' changes value from 9223372036854775807 to 9223372
> 036854775808 [-Werror,-Wimplicit-int-float-conversion]
> if (dval >= LONG_MAX)
> ~~ ^~~~~~~~
> /stpool/devel/netbsd/current/amd64/usr/src/obj/destdir.amd64/usr/include/machine/limits.h:56:18: note: expanded from macro 'LONG_MAX'
> #define LONG_MAX 0x7fffffffffffffffL /* max value for a long */
> ^~~~~~~~~~~~~~~~~~~
> 1 error generated.
> *** [timexsup.o] Error code 1
>
> nbmake[10]: stopped in /stpool/devel/netbsd/current/amd64/usr/src/external/bsd/ntp/lib/libntp
> 1 error
>
> >How-To-Repeat:
> compile latest CURRENT amd64 with clang
> >Fix:
> n/a
>
Replying to my own bug report here : casting LONG_MAX and LONG_MIN to double on lines 33 and 35, respectively, fixes the issue, but it's shoddy, IMHO.
Home |
Main Index |
Thread Index |
Old Index