gpsd-dev
[Top][All Lists]
Advanced

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

Re: [gpsd-dev] build failure, again, due to endian.h issues


From: Paul Fertser
Subject: Re: [gpsd-dev] build failure, again, due to endian.h issues
Date: Wed, 6 Nov 2013 13:44:23 +0400
User-agent: Mutt/1.5.17 (2007-11-30)

Hi,

On Tue, Nov 05, 2013 at 08:48:52PM -0500, Eric S. Raymond wrote:
> #define IS_BIG_ENDIAN (*(uint16_t *)"\0\xff" < 0x100)

I'd expect that string literal to be of type (char[3]) and it can be
implicitly converted to (char *) and so casting it to (uint16_t *)
would increase alignment requirements (also, if you ever decide to
compile gpsd with a C++ compiler it'll also remove constness as string
literals are const in C++) and that usually produces a warning with
arm-none-eabi or clang. The alignment restrictions seem to be a real
issue here so this nice trick is likely to be invalid C99.

-- 
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:address@hidden



reply via email to

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