Re: [RFC, doc] Note variable shadowing at max macro using statement expression

2019-04-09 Thread Sandra Loosemore
On 4/8/19 5:38 AM, Tom de Vries wrote: Hi, When suggesting to rewrite the unsafe (with respect to multiple evaluation of arguments) macro definition: ... #define max(a,b) ((a) > (b) ? (a) : (b)) ... into the safe macro definition: ... #define maxint(a,b) \ ({int _a = (a), _b = (b); _a

[RFC, doc] Note variable shadowing at max macro using statement expression

2019-04-08 Thread Tom de Vries
Hi, When suggesting to rewrite the unsafe (with respect to multiple evaluation of arguments) macro definition: ... #define max(a,b) ((a) > (b) ? (a) : (b)) ... into the safe macro definition: ... #define maxint(a,b) \ ({int _a = (a), _b = (b); _a > _b ? _a : _b; }) ... mention the variable