autoconf-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] AC_C_BIGENDIAN: fix narrowing error


From: Eric Blake
Subject: Re: [PATCH] AC_C_BIGENDIAN: fix narrowing error
Date: Mon, 12 Mar 2018 07:47:04 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 03/12/2018 04:24 AM, Rechi wrote:
The following patch will fix AC_C_BIGENDIAN, for cross compiling, if narrowing is a fatal error in the used compiler.

Narrowing should not be a fatal error unless you used -Werror, which we advise against doing (it is impossible in general to write all configure snippets to be warning-proof against all possible -Werror settings). However, if the change is easy to maintain, I don't mind including an obvious warning avoidance patch.

+++ b/lib/autoconf/c.m4
@@ -1655,9 +1655,9 @@ AC_DEFUN([AC_C_BIGENDIAN],
                 int use_ascii (int i) {
                   return ascii_mm[i] + ascii_ii[i];
                 }
-               short int ebcdic_ii[] =
+               unsigned short int ebcdic_ii[] =
                   { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-               short int ebcdic_mm[] =
+               unsigned short int ebcdic_mm[] =
                   { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };

and that is easy to maintain, so I'll go ahead and incorporate it when I get a chance.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

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