public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103862] New: Regression: -Wold-style-cast warns about system macros
@ 2021-12-29 23:38 carlosgalvezp at gmail dot com
  2021-12-29 23:40 ` [Bug c++/103862] " carlosgalvezp at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: carlosgalvezp at gmail dot com @ 2021-12-29 23:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103862

            Bug ID: 103862
           Summary: Regression: -Wold-style-cast warns about system macros
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: carlosgalvezp at gmail dot com
  Target Milestone: ---

Hi,

I thought this problem was solved by reading this: 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12258

But I can still find it on GCC 11.1:

// include/third_party.h
#pragma once

#define MY_CAST(x) ((int)x)

// main.cpp
#include <third_party.h>

int main() 
{
    int x = MY_CAST(123);
    return x;
}

# g++-11 -isystem 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 = MY_CAST(123);
      |                     ^~~

# g++-11 --version
g++-11 (Ubuntu 11.1.0-1ubuntu1~20.04) 11.1.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-30 23:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-29 23:38 [Bug c++/103862] New: Regression: -Wold-style-cast warns about system macros carlosgalvezp at gmail dot com
2021-12-29 23:40 ` [Bug c++/103862] " carlosgalvezp at gmail dot com
2021-12-29 23:47 ` pinskia at gcc dot gnu.org
2021-12-29 23:51 ` carlosgalvezp at gmail dot com
2021-12-30 23:44 ` [Bug c++/103862] " colomar.6.4.3 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).