public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/12258] New: -Wold-style-cast triggers on casts in macros from system headers
@ 2003-09-12 1:58 stl at caltech dot edu
2003-09-17 5:23 ` [Bug preprocessor/12258] " pinskia at gcc dot gnu dot org
2004-03-13 2:11 ` stl at caltech dot edu
0 siblings, 2 replies; 5+ messages in thread
From: stl at caltech dot edu @ 2003-09-12 1:58 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12258
Summary: -Wold-style-cast triggers on casts in macros from system
headers
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: stl at caltech dot edu
CC: gcc-bugs at gcc dot gnu dot org
See this thread:
http://gcc.gnu.org/ml/gcc/2003-09/msg00162.html
Basically, if something like
#pragma GCC system_header
#define NOTHING (int) 0
appears in something.h, and meow.cc consists of
#include <something.h>
int blah = NOTHING;
and meow.cc is compiled with -Wold-style-cast, the warning will trigger.
I originally encountered this using MinGW gcc 3.3, but Zack Weinberg's
comments in the thread indicate that no version of gcc anywhere yet knows
enough to not emit this warning.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug preprocessor/12258] -Wold-style-cast triggers on casts in macros from system headers
2003-09-12 1:58 [Bug c++/12258] New: " stl at caltech dot edu
@ 2003-09-17 5:23 ` pinskia at gcc dot gnu dot org
2004-03-13 2:11 ` stl at caltech dot edu
1 sibling, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-09-17 5:23 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12258
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|c++ |preprocessor
Ever Confirmed| |1
Keywords| |diagnostic
Last reconfirmed|0000-00-00 00:00:00 |2003-09-17 05:14:26
date| |
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-09-17 05:14 -------
This is reallly a preprocess failure (as the preprocessor does not tell the front-end that the code is
from a system header). It is also related to bug 11931 and bug 7263.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug preprocessor/12258] -Wold-style-cast triggers on casts in macros from system headers
2003-09-12 1:58 [Bug c++/12258] New: " stl at caltech dot edu
2003-09-17 5:23 ` [Bug preprocessor/12258] " pinskia at gcc dot gnu dot org
@ 2004-03-13 2:11 ` stl at caltech dot edu
1 sibling, 0 replies; 5+ messages in thread
From: stl at caltech dot edu @ 2004-03-13 2:11 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From stl at caltech dot edu 2004-03-13 02:11 -------
My current workaround is similar to what Kai Henningsen proposed: I have my
own const constants for #define'd constants, as well as my own functions for
#define'd macros (e.g. FD_SET), in a separate header which I then mark as a
GCC system header. This produces warning-free code. It's a dirty hack, though.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12258
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-12-30 10:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-12258-4@http.gcc.gnu.org/bugzilla/>
2010-11-23 18:18 ` [Bug preprocessor/12258] -Wold-style-cast triggers on casts in macros from system headers hjl at gcc dot gnu.org
2021-12-29 23:40 ` carlosgalvezp at gmail dot com
2021-12-30 10:30 ` redi at gcc dot gnu.org
2003-09-12 1:58 [Bug c++/12258] New: " stl at caltech dot edu
2003-09-17 5:23 ` [Bug preprocessor/12258] " pinskia at gcc dot gnu dot org
2004-03-13 2:11 ` stl at caltech dot edu
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).