[sane-devel] Switching to C99 (was Fwd: Re: epsonds won't build with is_release=yes)
Olaf Meeuwissen
paddy-hack at member.fsf.org
Tue Oct 13 13:00:05 UTC 2015
Hi Devs,
I figured I'd better change the Subject: so you actually notice that
we're talking about bumping the C language standard level for SANE to
ISO C99. Until now, sane-backends code was supposed to be ANSI C (C89),
which, for all intents and purposes, is the same as ISO C90.
Below, I suggest compiling a list of pros and cons and invite the SANE
developers to support or object to the change.
Olaf Meeuwissen writes:
> Hi Devs,
>
> m. allan noah writes:
>
>> I think we should switch to C99 now.
>>
>> On Wed, Oct 7, 2015 at 1:53 PM, Alessandro Zummo
>> <azummo-lists at towertech.it> wrote:
>>> On Sat, 03 Oct 2015 12:59:56 +0900
>>> Olaf Meeuwissen <paddy-hack at member.fsf.org> wrote:
>>>
>>>> I don't understand why during development with gcc -std=c90 (aka -ansi)
>>>> is in effect but when we release we no longer care and allow whatever
>>>> the compiler thinks is good for you. In case of gcc that is -std=gnu90
>>>> or, as of gcc-5, -std=gnu11.
>>>
>>> Now that it's released, can we switch to c99, if not c11? :)
>
> You won't hear me complain about switching to C99 (*without* GNU
> extensions in the interest of portability). Switching to C11 is
> probably still a bit too early (although I don't mind).
>
> However, before we decide to switch, wouldn't it be a good idea to list
> the "overwhelming" benefits of switching and "disabling" drawbacks of
> not doing so? Here's something to get started:
>
> Benefits:
> - allows declarations after statements (which I consider a mixed
> blessing)
> - allows C++-style // comments (not sure if they are also allowed in
> C preprocessor code though)
> - has snprintf()
> - additional standardized headers (which ones?)
>
> Drawbacks:
> - ISO has withdrawn C99 (in favour of C11)
>
> Also, if there's developers out there that object, now is probably a
> good idea to do so.
>
> Hope this helps,
--
Olaf Meeuwissen, LPIC-2 FSF Associate Member since 2004-01-27
Support Free Software Support the Free Software Foundation
https://my.fsf.org/donate https://my.fsf.org/join
GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9
More information about the sane-devel
mailing list