This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Compile s_llround.c with -Wno-error for x32 build
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 19 Dec 2014 16:25:18 +0000
- Subject: Re: [PATCH] Compile s_llround.c with -Wno-error for x32 build
- Authentication-results: sourceware.org; auth=none
- References: <20141219134216 dot GA5739 at gmail dot com>
On Fri, 19 Dec 2014, H.J. Lu wrote:
> On x32, I got
>
> ../sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c:75:24: error:
> conflicting types for built-in function âlroundâ [-Werror]
> weak_alias (__llround, lround)
> ^
> ./../include/libc-symbols.h:128:26: note: in definition of macro
> â_weak_aliasâ
> extern __typeof (name) aliasname __attribute__ ((weak, alias
> (#name)));
> ^
> ../sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c:75:1: note: in
> expansion of macro âweak_aliasâ
> weak_alias (__llround, lround)
> ^
> cc1: all warnings being treated as errors
>
> Since x32 returns 32-bit long int and 64-bit long long int in the
> same 64-bit register, we make the 32b-bit lround an alias of the
> 64-bit llround. This patch adds -Wno-error for x32 build to silence
> the compiler. Verified on x32, i686 and x86-64 with GCC 4.8.3. I
> checked it in as an obvious fix.
I think -fno-builtin-lround would be better than -Wno-error if it works to
fix the warning. (Cf. the CFLAGS-nldbl-*.c settings in
sysdeps/ieee754/ldbl-opt/Makefile.)
--
Joseph S. Myers
joseph@codesourcery.com