[sheepdog] [PATCH RFC] employ gnu99 style of GCC

Hitoshi Mitake mitake.hitoshi at gmail.com
Mon Apr 29 17:08:28 CEST 2013


At Mon, 29 Apr 2013 22:52:09 +0800,
Liu Yuan wrote:
> 
> On 04/29/2013 10:25 PM, Hitoshi Mitake wrote:
> > Oops, sorry. The above macro doesn't work well with the line like this:
> > 		cache->lru_tree = RB_ROOT;
> > # 594 of object_cache.c
> > 
> > I think these sort of initialization should be done with a macro like
> > INIT_LIST_HEAD(). Is it okay to implement INIT_RB_ROOT()?
> 
> what else useful things can we get besides 'for (int i = 0;...)' from
> gnu99 ? We have to pay prices so we need to know if it is worthy of it.

Below are major benefits:

1. interleaving declarations and statements
2. Unnamed struct/union fields:
   http://gcc.gnu.org/onlinedocs/gcc/Unnamed-Fields.html#Unnamed-Fields
   With this feature, journal_write_store() and journal_write_epoch()
   can be cleaner.

Thanks,
Hitoshi



More information about the sheepdog mailing list