On Dec 6, 2013, at 1:26 PM, Jarno Rajahalme <jrajaha...@nicira.com> wrote:

> 
> On Dec 6, 2013, at 11:02 AM, Ben Pfaff <b...@nicira.com> wrote:
>> 
>> Clang reports:
>>    ../lib/classifier.c:1570:40: error: bad constant expression
>> referring to this line in trie_remove():
>>    struct trie_node *nodes[trie->field->n_bytes];
>> 
> 

Minor note: I had intended to write “n_bits” instead of “n_bytes” here...

  Jarno

> Mine is not doing that, running clang 1:3.4~svn193316-1~exp1. Anyway 
> allocating variable sized arrays from stack is a C99 feature that CodingStyle 
> does not seem to mention. I guess it would be better avoiding it then and 
> replace the size with the biggest possible (sizeof(union mf_value) * 8) (and 
> I was missing the “* 8” multiplier from it anyway, the size needs to be the 
> max possible depth of the tree!
> 
>> I'll have more comments later today.
> 
> OK, thanks!
> 
>   Jarno

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to