https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103862
Alejandro Colomar <colomar.6.4.3 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |colomar.6.4.3 at gmail dot com
--- Comment #4 from Alejandro Colomar <colomar.6.4.3 at gmail dot com> ---
Hi,
I tried GCC 12 from Debian experimental and I can still reproduce the bug:
$ g++-12 --version
g++-12 (Debian 12-20211217-1) 12.0.0 20211217 (experimental) [master
r12-6027-g774269aa4b9]
I found something weird: if you enclose the macro argument in parentheses, the
warning is silenced:
#define MY_CAST(x) ((int)(x))
P.S.: If system header macros can be warned if part of the expression comes
from user code, I'd really like see -Wsizeof-pointer-div reporting warnings.
See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94746>