[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] AC_C_BIGENDIAN: fix narrowing error
From: |
Rechi |
Subject: |
[PATCH] AC_C_BIGENDIAN: fix narrowing error |
Date: |
Mon, 12 Mar 2018 10:24:47 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
The following patch will fix AC_C_BIGENDIAN, for cross compiling, if
narrowing is a fatal error in the used compiler.
error: narrowing conversion of ‘35283’ from ‘int’ to ‘short int’ inside
{ } [-Wnarrowing]
{ 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
^
error: narrowing conversion of ‘58339’ from ‘int’ to ‘short int’ inside
{ } [-Wnarrowing]
error: narrowing conversion of ‘34195’ from ‘int’ to ‘short int’ inside
{ } [-Wnarrowing]
error: narrowing conversion of ‘38341’ from ‘int’ to ‘short int’ inside
{ } [-Wnarrowing]
error: narrowing conversion of ‘35268’ from ‘int’ to ‘short int’ inside
{ } [-Wnarrowing]
error: narrowing conversion of ‘38273’ from ‘int’ to ‘short int’ inside
{ } [-Wnarrowing]
error: narrowing conversion of ‘49865’ from ‘int’ to ‘short int’ inside
{ } [-Wnarrowing]
{ 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
^
error: narrowing conversion of ‘51077’ from ‘int’ to ‘short int’ inside
{ } [-Wnarrowing]
error: narrowing conversion of ‘38340’ from ‘int’ to ‘short int’ inside
{ } [-Wnarrowing]
error: narrowing conversion of ‘35201’ from ‘int’ to ‘short int’ inside
{ } [-Wnarrowing]
error: narrowing conversion of ‘38370’ from ‘int’ to ‘short int’ inside
{ } [-Wnarrowing]
error: narrowing conversion of ‘43234’ from ‘int’ to ‘short int’ inside
{ } [-Wnarrowing]
--- a/lib/autoconf/c.m4
+++ 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 };
int use_ebcdic (int i) {
return ebcdic_mm[i] + ebcdic_ii[i];
- [PATCH] AC_C_BIGENDIAN: fix narrowing error,
Rechi <=