lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] Issue with gcc 6.3 s390x with 32 bit - format error ?


From: Ivan Warren
Subject: [lwip-devel] Issue with gcc 6.3 s390x with 32 bit - format error ?
Date: Thu, 18 Oct 2018 00:46:16 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Hello all,

I am getting the following error on git head while cross compiling lwipcore (x64->s390x) on debian :

/home/ivan/lwip/src/lwip/src/core/mem.c:1005:54: error: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘size_t {aka long unsigned int}’ [-Werror=format=]      LWIP_DEBUGF(MEM_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("mem_calloc: could not allocate %"SZT_F" bytes\n", alloc_size));

This is very odd since I am compiling this (through a wrapper) with gcc -m31 (read -m32 .. the 31 is a s390/s390x quirk) and "unsigned int" have exactly the same width and sign as "long unsigned int" (32 bit unsigned value) - so should NOT trigger the gcc warning ! (gcc bug ?)

To me there is no error in lwip at this point (SZT_F is defined in arch.h as PRIuPTR which should work just fine).

A s390x 64 bit compiles just fine (but doesn't fit in my project)

Changing SZT_F to "lu" (or defining LWIP_HAVE_INTTYPES as 0 and providing my own definition of SZT_F) solves my problem (as a workaround only.. this is definitelly not a permament solution).

Just food for thought/thinking out loud.. (not a pressing issue since I have an easy workaround)

--Ivan


Attachment: smime.p7s
Description: Signature cryptographique S/MIME


reply via email to

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