Re: [PATCH 2/2] commit-slab.h: avoid duplicated global static variables

2016-08-09 Thread Junio C Hamano
Johannes Sixt writes: > * like function declarations. I.e., the expansion of > * > *define_commit_slab(indegree, int); > * > - * ends in 'static int stat_indegreerealloc;'. This would otherwise > + * ends in 'struct indegree;'. This would otherwise > * be a syntax

Re: [PATCH 2/2] commit-slab.h: avoid duplicated global static variables

2016-08-09 Thread Johannes Sixt
BTW, these are all instances of duplicated global static variables that can be found in a standard Linux build. How I found them? I waded through the error messages produced by compiling the code base as C++ code for the fun of it (basically CFLAGS='-x c++ -fpermissive'). -- Hannes -- To

[PATCH 2/2] commit-slab.h: avoid duplicated global static variables

2016-08-09 Thread Johannes Sixt
The gigantic define_commit_slab() macro repeats the definition of a static variable that occurs earlier in the macro text. The purpose of the repeated definition at the end of the macro is that it takes the semicolon that occurs where the macro is used. We cannot just remove the first definition