On Tue, Dec 17, 2013 at 10:29:03AM +0100, Petr Spacek wrote:
> On 17.12.2013 10:12, Jakub Hrozek wrote:
> >On Tue, Dec 17, 2013 at 08:19:09AM +0100, Jan Cholasta wrote:
> >>Hi,
> >>
> >>On 16.12.2013 22:12, Nathaniel McCallum wrote:
> >>>Patch attached.
> >>
> >>Care to elaborate? There's no ticket or explanation why this is
> >>beneficial or necessary.
> >
> >We had a short chat with Nathaniel yesterday on IRC about which C standards
> >we, as a project, allow. I think this patch is a result of that discussion.
> >
> >SSSD has had -std=gnu99 in the default CFLAGS for more than a year now.
> >
> >I think we can safely support C99 and its features now, it's almost 2014
> >and all major compilers support the features we care about. But I think
> >this change should go hand-in-hand with amending
> >http://www.freeipa.org/page/Coding_Style
> >
> >For instance, would variable-length arrays considered OK? (I would vote
> >yes),
> 
> Please no. You can't catch the error if the memory allocation fails
> for whatever reason and the process will killed by OS.
> 
> (There is a question if you want to handle memory allocation
> failures at all, of course.)

I thought that variable length arrays were allocated on the stack?

So yes, you need to be careful and only allow use VLAs when you absolutely
know that the value is small and you don't run past the stack size.

But that's not really what I wanted to discuss now, I mostly wanted to
bring up that if we allow some extra language features, we should agree
on whether it's OK to use all of them.

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to