[Geany-Devel] Lets move to C99

Matthew Brush mbrush at xxxxx
Fri Aug 16 20:09:59 UTC 2013


On 13-08-16 05:29 AM, Colomban Wendling wrote:
> Le 16/08/2013 08:07, Matthew Brush a écrit :
>> Hi,
>>
>> [...]
>> - mixed declarations and code
>
> NO.
>
>> [...]
>>
>> - Coding in the new millennium style :)
>
> No point in that, it's not like switching to a modern language, just a
> few small corner changes to improve the language.
>
>> - Microsoft Visual C++ compiler is not C99 conformant and plans not to
>> ever be AFAIK (of little consequence since we don't compile with MSVC).
>
> That'd be a point against it, although MSVC always was crappy for C, no
> matter which C version :-'
>
>> - Allowed to use // style comments
>
> Honestly, although they are a little practical to quickly comment a line
> without having to care if it's already a comment or something, I don't
> see much need for this, I'm just fine with /**/
>
>> - Allowed to declare loop counter-style variable inside the for loop.
>
> Yeah, that's kinda fun.
>
>> - Use standard C instead of G*-portability wrappers in various place
>> (bool, fixed-width ints, etc.).
>>
>> This is just sort of random, but I feel that some our code could be
>> better if we depended less on G*-stack and more on (>10 year old) ISO
>> standards.
>
> One question: why?  There are only very few things that we really do use
> from GLib that C99 has, and even if it does, what's the matter?
>
> Rant against G* if you wish, no problem, but then just drop it
> altogether, "upgrading" to C99 won't change anything in this matter.
>

Not meant as a rant against G*, when it was started (~1998 IIRC), there 
was a reason for wrapping all the (then) non-standard stuff for 
portability. But now, it just makes it harder for people to contribute 
code since many are used to using standard C (or more likely C++) and 
have to double check everything to make sure that nothing post 1989 was 
used unless it has a g in front of it.

>> P.S. Sorry for the bikeshed bait.
>
> Yeah, and sorry to sound so annoying (especially in the other mail ;),
> but I really see this as "let's upgrade for the sake of upgrading", and
> I don't see the point.  And this annoys me when you try to justify it by
> ranting against G* -- not that I care about the rant, but because it's a
> false justification.
>

Although I often do rant against G*, I didn't do that here at all, I 
don't think. My point is why does everyone (core devs and especially 
other drive-by contributors) have to use rules from before you were born 
(or so), just for the sake of you being able to stick -pedantic -std=c89 
on your compiler command line? It seems so arbitrary.

Even if it was only for // comments, what's the argument for *NOT* 
starting to use a well-established ISO standard that's already one full 
iteration behind the current standard? Sure we might only use 4 or 5 
"new" language features in practice as opposed to the full list I 
pasted, but so what? Why not? What do we lose by doing this?

BTW, what originally inspired me to send this message was that many many 
PRs have this comment attached to them: "no //-style comment, we use 
C89" (paraphrasing). IMO that's a crap reason for blocking a 
contribution or making someone (who used a perfectly standard C feature) 
add another commit, squash it into the previous ones and open a new pull 
request (or however it gets dealt with).

{ .Cheers = "Matthew Brush" };



More information about the Devel mailing list