[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] build failure, again, due to endian.h issues
From: |
Greg Troxel |
Subject: |
Re: [gpsd-dev] build failure, again, due to endian.h issues |
Date: |
Wed, 06 Nov 2013 08:56:13 -0500 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/23.4 (berkeley-unix) |
"Eric S. Raymond" <address@hidden> writes:
> Paul Fertser <address@hidden>:
>> 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.
>
> I'll try it under clang and see.
That's really not good enough. One must be able to argue from the text
of the standard that it will work.
pgpwkrHAvRjvs.pgp
Description: PGP signature
- [gpsd-dev] build failure, again, due to endian.h issues, Greg Troxel, 2013/11/05
- Re: [gpsd-dev] build failure, again, due to endian.h issues, Eric S. Raymond, 2013/11/05
- Re: [gpsd-dev] build failure, again, due to endian.h issues, Beat Bolli, 2013/11/06
- Re: [gpsd-dev] build failure, again, due to endian.h issues, Greg Troxel, 2013/11/06
- Re: [gpsd-dev] build failure, again, due to endian.h issues, Eric S. Raymond, 2013/11/06
- Re: [gpsd-dev] build failure, again, due to endian.h issues, Greg Troxel, 2013/11/06
- [gpsd-dev] [PATCH] RTCM V2: use scons to determine the location of <endian.h>., Beat Bolli, 2013/11/08
- Re: [gpsd-dev] build failure, again, due to endian.h issues, Beat Bolli, 2013/11/06