From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 010D23858400; Wed, 29 Dec 2021 23:51:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 010D23858400 From: "carlosgalvezp at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/103862] Regression: -Wold-style-cast warns about system macros Date: Wed, 29 Dec 2021 23:51:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: carlosgalvezp at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Dec 2021 23:51:10 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103862 --- Comment #3 from Carlos Galvez --- Interesting, thanks for the quick reply! In case it helps, if I include the header as a regular header, I do get the "note" referring to the system hea= der: # g++-11 -I include -Wold-style-cast main.cpp In file included from main.cpp:1: main.cpp: In function 'int main()': main.cpp:5:21: warning: use of old-style cast to 'int' [-Wold-style-cast] 5 | int x =3D MY_CAST(123); | ^~~ include/third_party.h:3:26: note: in definition of macro 'MY_CAST' 3 | #define MY_CAST(x) ((int)x) |=