[neomutt-devel] About C flavour (Was: Refactoring's cosmetics ?)

guyzmo z+mutt+neomutt at m0g.net
Thu Jan 26 16:07:19 CET 2017


On Thu, Jan 26, 2017 at 03:42:35PM +0100, Pietro Cerutti wrote:
> On 2017-Jan-26, 15:20, toogley at mailbox.org wrote:
> > > >  - single line `//` comments,
> > > >  - stdbool/stdint, 
> > > >  - variable and flexible arrays,
> > > I'd say no to VLAs, but I won't stress on that..
> > what is the reason for that?
> 
> The main reason is that - unless heap allocation - you have no way to
> recover from a stack allocation failure. 

hm… recovering from heap allocation failure, that I can see, but if you
can't allocate on the stack, I don't see how you'd recover. When that
happens, you've already crossed the line to hell, and all you can do is
exit fast.

> Also, their semantics is kind of messy.. not having their size known
> at compile time means you can't sizeof them like you do for normal
> arrays.

well, if you declare it with a variable available in the same context,
then shouldn't need to `sizeof()` that array, you already got the size
available as that variable!

> Plus, they became optional in C11.. 

yup, that I did not really understand…

-- 
Z


More information about the neomutt-devel mailing list