[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] gpsd style change?
From: |
Greg Troxel |
Subject: |
Re: [gpsd-dev] gpsd style change? |
Date: |
Wed, 11 Feb 2015 11:14:59 -0500 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.4 (berkeley-unix) |
"Eric S. Raymond" <address@hidden> writes:
> Greg Troxel <address@hidden>:
>> I'm not against moving declarations to inner scopes, but IIRC that's a
>> C99 vs C89 thing. We do need to be clear on the target language
>> specification, vs coding to what whatever gcc version is installed
>> accepts.
>
> I don't understand how C89 vs. C99 enters into it. Explain?
My memory is a bit fuzzy. Long ago, one could only declare variables at
the top of a function, before any statements. I think that's still true
in C89, and C99 permitted arbitrary ordering (as a nod to C++).
> For the record, I do assume C99. Among other things, the code makes
> significant use of bool, designated initializers, and inline.
That seems entirely reasonable in 2015.
There does seem to be a trailing-edge attitude in the embedded world
about sticking to C89 much longer than others did.
> However, I don't intermix declarations with executable statements because
> that gives splint the screaming fantods (dies with an internal error). Nor
> does the code use variadic macros, flexible arrays, type-generic math,
> or type complex.
Entirely reasonable, but should be documented.
pgpgXBcjRwP9H.pgp
Description: PGP signature