gpsd-dev
[Top][All Lists]
Advanced

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

Re: [gpsd-dev] several messages


From: Fred Wright
Subject: Re: [gpsd-dev] several messages
Date: Mon, 15 Aug 2016 15:44:54 -0700 (PDT)

On Mon, 15 Aug 2016, Eric S. Raymond wrote:
> Fred Wright <address@hidden>:
> > It's not even consistent across SAS/C, though.  SAS/C on the Amiga defines
> > it as a long as usual.  I'm not sure the IBM 370 is a terribly useful
> > target for GPSD. :-)
>
> You'll laugh, but I once found an actual signedness problem in the
> GPSD code for interpolating geodetic deviation only because I compiled
> it against S370 in the Debian server farm.

Because it didn't work, or because of stricter compiler warnings?  The 370
is a big-endian twos-complement machine with 8-bit-byte-oriented memory
addressing, which isn't terribly unusual.  Though I suppose there's the
usual issue of whether char is signed or unsigned by default.

> S370 may not be an interesting deployment target, but I'm sold on it
> as a torture test for our assumptions.

If you *really* want a torture test, try building it for a PDP-10. :-)

On Fri, 12 Aug 2016, Fred Wright wrote:

> AFAICT the issue is __LONG_LONG_SUPPORTED, which in turn isn't set if it's
> not C99 and either -ansi or -posix is specified.

More generally, the problem is that even compilers that support C99
features aren't necessarily in "C99 mode" by default.  Typically, the
compiler isn't picky about letting you use such features even when not in
"C99 mode", except that if you enable strict warnings then it assumes that
you really want strict warnings.

It appears that the "officially recommended" way to get a C99-compliant
compiler is to invoke it as 'c99', rather than as 'cc' (or 'gcc').  Often
this is just a wrapper that supplies the appropriate option(s).  But the
'c99' command doesn't necessarily exist on all platforms, even with C99
support, so as usual the "official way" isn't the most portable way.  And
the cross-building toolchains I've looked at don't include a <prefix>-c99
command, either.

So having something which is both highly portable and warning-free is
somewhat of a battle.

Fred Wright



reply via email to

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