[SSSD] [PATCH] Adding -std=gnu99 flag.

Stephen Gallagher sgallagh at redhat.com
Tue Aug 28 16:31:52 UTC 2012


On Tue, 2012-08-28 at 17:37 +0200, Michal Židek wrote:
> On 08/28/2012 04:32 PM, Stephen Gallagher wrote:
> 
> > On Tue, 2012-08-28 at 15:42 +0200, Michal Židek wrote:
> > > GCC defaults to gnu89 if no explicit standard was set by -std flag.
> > > I think there is no reason to stick to this old standard. It was
> > > discussed earlier off-list and if nobody has anything against it,
> > > please apply this patch to use gnu99 instead of 89 (for gcc).
> > > 
> > > The patch is attached.
> > 
> > Ack to the patch, but would you mind identifying what features of gnu99
> > we want to take advantage of? Where's the value in this patch?
> 
> A feature I really miss is declaration of variables in for cycles.
> It is ugly to create variables with names like 'i', 'a' (or whatever)
> at function start if all you need is one or two for cycle 'iterators'.
> 

I'd prefer to actually forbid this entirely in our style guidelines.
Declaring variables in for-loops is a pretty good way to screw up
scoping. I've seen MANY mistakes start this way.

> But in general, I think the selection of standard should be explicit
> (I 
> am really not sure if the default GCC standard is 'gnu89' or 
> 'gnu89 + something'). And if we have to make it explicit, why bother
> with 89? With 99 we can count with these features:
> 
> http://gcc.gnu.org/c99status.html
> + gnu extensions.
> 
> It is not like we need them all, but there is also no reason
> to get rid off them.


Sure, makes sense to pick a standard and stick with it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120828/febe21b1/attachment.sig>


More information about the sssd-devel mailing list