On Wed, 16 Oct 2019, Jakub Jelinek wrote:
> The counter example would be:
> #define F(x) \
> __extension__ (({ __typeof__ (x) _x = x; _x < 0 ? -_x : _x; }))
> #define G(x) \
> __extension__ (({ __typeof__ (x) _x = x; F(_x); }))
> where a -Wshadow diagnostics could point the author at a serious bug,
> because in the expansion it will be __typeof__ (_x) _x = _x; ...
And this is not theoretical,
<https://sourceware.org/bugzilla/show_bug.cgi?id=15667>
<https://sourceware.org/ml/libc-alpha/2013-06/msg00851.html> was a real
bug in glibc soft-fp where shadowing of variables called _c1 and _c2 in
two macros resulted in wrong code.
--
Joseph S. Myers
[email protected]