public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/47700] New: Warning for C casts in C++
@ 2011-02-11 16:54 olafvdspek at gmail dot com
  2011-02-11 16:59 ` [Bug c++/47700] " pinskia at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: olafvdspek at gmail dot com @ 2011-02-11 16:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47700

           Summary: Warning for C casts in C++
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: olafvdspek@gmail.com


Some consider C casts in C++ code bad. g++ -Wall -pedantic doesn't warn. Could
this (optional) warning be added?


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

* [Bug c++/47700] Warning for C casts in C++
  2011-02-11 16:54 [Bug c++/47700] New: Warning for C casts in C++ olafvdspek at gmail dot com
@ 2011-02-11 16:59 ` pinskia at gcc dot gnu.org
  2011-02-11 17:05 ` redi at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-02-11 16:59 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47700

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-02-11 16:56:15 UTC ---
There is already an option: -Wold-style-cast .


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

* [Bug c++/47700] Warning for C casts in C++
  2011-02-11 16:54 [Bug c++/47700] New: Warning for C casts in C++ olafvdspek at gmail dot com
  2011-02-11 16:59 ` [Bug c++/47700] " pinskia at gcc dot gnu.org
@ 2011-02-11 17:05 ` redi at gcc dot gnu.org
  2011-02-11 17:07 ` olafvdspek at gmail dot com
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu.org @ 2011-02-11 17:05 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47700

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WORKSFORME

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-02-11 17:00:04 UTC ---
^^


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

* [Bug c++/47700] Warning for C casts in C++
  2011-02-11 16:54 [Bug c++/47700] New: Warning for C casts in C++ olafvdspek at gmail dot com
  2011-02-11 16:59 ` [Bug c++/47700] " pinskia at gcc dot gnu.org
  2011-02-11 17:05 ` redi at gcc dot gnu.org
@ 2011-02-11 17:07 ` olafvdspek at gmail dot com
  2011-02-11 17:18 ` pinskia at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: olafvdspek at gmail dot com @ 2011-02-11 17:07 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47700

Olaf van der Spek <olafvdspek at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|WORKSFORME                  |

--- Comment #3 from Olaf van der Spek <olafvdspek at gmail dot com> 2011-02-11 17:05:20 UTC ---
Can't find it at
http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#Warning-Options

Why isn't it included in -Wall -Wextra -pedantic?


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

* [Bug c++/47700] Warning for C casts in C++
  2011-02-11 16:54 [Bug c++/47700] New: Warning for C casts in C++ olafvdspek at gmail dot com
                   ` (2 preceding siblings ...)
  2011-02-11 17:07 ` olafvdspek at gmail dot com
@ 2011-02-11 17:18 ` pinskia at gcc dot gnu.org
  2011-02-11 17:28 ` olafvdspek at gmail dot com
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-02-11 17:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47700

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-02-11 17:12:07 UTC ---
Try
http://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/C_002b_002b-Dialect-Options.html#index-Wno_002dold_002dstyle_002dcast-178
.


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

* [Bug c++/47700] Warning for C casts in C++
  2011-02-11 16:54 [Bug c++/47700] New: Warning for C casts in C++ olafvdspek at gmail dot com
                   ` (3 preceding siblings ...)
  2011-02-11 17:18 ` pinskia at gcc dot gnu.org
@ 2011-02-11 17:28 ` olafvdspek at gmail dot com
  2011-02-11 17:42 ` redi at gcc dot gnu.org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: olafvdspek at gmail dot com @ 2011-02-11 17:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47700

--- Comment #5 from Olaf van der Spek <olafvdspek at gmail dot com> 2011-02-11 17:18:05 UTC ---
I don't get why it's listed on that page. IMO it should be at
http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#Warning-Options

Why isn't it included in -Wall -Wextra -pedantic?


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

* [Bug c++/47700] Warning for C casts in C++
  2011-02-11 16:54 [Bug c++/47700] New: Warning for C casts in C++ olafvdspek at gmail dot com
                   ` (4 preceding siblings ...)
  2011-02-11 17:28 ` olafvdspek at gmail dot com
@ 2011-02-11 17:42 ` redi at gcc dot gnu.org
  2011-02-11 17:43 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu.org @ 2011-02-11 17:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47700

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WORKSFORME

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-02-11 17:40:21 UTC ---
(In reply to comment #5)
> I don't get why it's listed on that page. IMO it should be at
> http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#Warning-Options

That's for language-independent options. It says "For further,
language-specific options also refer to C++ Dialect Options ..."


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

* [Bug c++/47700] Warning for C casts in C++
  2011-02-11 16:54 [Bug c++/47700] New: Warning for C casts in C++ olafvdspek at gmail dot com
                   ` (5 preceding siblings ...)
  2011-02-11 17:42 ` redi at gcc dot gnu.org
@ 2011-02-11 17:43 ` redi at gcc dot gnu.org
  2011-02-11 17:49 ` olafvdspek at gmail dot com
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu.org @ 2011-02-11 17:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47700

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-02-11 17:41:29 UTC ---
Or more accurately, multi-language, not language-independent.  In any case
-Wold-style-cast is C++-only so is on a separate page.


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

* [Bug c++/47700] Warning for C casts in C++
  2011-02-11 16:54 [Bug c++/47700] New: Warning for C casts in C++ olafvdspek at gmail dot com
                   ` (6 preceding siblings ...)
  2011-02-11 17:43 ` redi at gcc dot gnu.org
@ 2011-02-11 17:49 ` olafvdspek at gmail dot com
  2011-02-11 19:56 ` manu at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: olafvdspek at gmail dot com @ 2011-02-11 17:49 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47700

--- Comment #8 from Olaf van der Spek <olafvdspek at gmail dot com> 2011-02-11 17:48:06 UTC ---
This isn't really about a dialect, so it still doesn't make sense.

And: Why isn't it included in -Wall -Wextra -pedantic?


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

* [Bug c++/47700] Warning for C casts in C++
  2011-02-11 16:54 [Bug c++/47700] New: Warning for C casts in C++ olafvdspek at gmail dot com
                   ` (7 preceding siblings ...)
  2011-02-11 17:49 ` olafvdspek at gmail dot com
@ 2011-02-11 19:56 ` manu at gcc dot gnu.org
  2011-02-12 13:50 ` olafvdspek at gmail dot com
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: manu at gcc dot gnu.org @ 2011-02-11 19:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47700

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #9 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2011-02-11 19:50:48 UTC ---
(In reply to comment #8)
> This isn't really about a dialect, so it still doesn't make sense.

By "dialect", the manual means "language", as in "warning specific to the C++
language". Why it uses the word "dialect" completely escapes to me? Feel free
to propose in gcc@gcc.gnu.org to change the word and see what people think.

> And: Why isn't it included in -Wall -Wextra -pedantic?

Because old-style casts are still used everywhere, it is more of a matter of
style, and adding new warnings to -Wall -Wextra will break building any project
that uses -Werror for code that is surely working fine. Users complain about
this all the time.

(-pedantic is for GCC specific extensions, so it doesn't apply).


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

* [Bug c++/47700] Warning for C casts in C++
  2011-02-11 16:54 [Bug c++/47700] New: Warning for C casts in C++ olafvdspek at gmail dot com
                   ` (8 preceding siblings ...)
  2011-02-11 19:56 ` manu at gcc dot gnu.org
@ 2011-02-12 13:50 ` olafvdspek at gmail dot com
  2011-06-29 19:45 ` redi at gcc dot gnu.org
  2011-06-29 20:00 ` manu at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: olafvdspek at gmail dot com @ 2011-02-12 13:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47700

Olaf van der Spek <olafvdspek at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
                URL|                            |http://gcc.gnu.org/onlinedo
                   |                            |cs/gcc-4.5.2/gcc/C_002b_002
                   |                            |b-Dialect-Options.html#inde
                   |                            |x-Wno_002dold_002dstyle_002
                   |                            |dcast-178
         Resolution|WORKSFORME                  |

--- Comment #10 from Olaf van der Spek <olafvdspek at gmail dot com> 2011-02-12 13:24:46 UTC ---
(In reply to comment #9)
> (In reply to comment #8)
> > This isn't really about a dialect, so it still doesn't make sense.
> 
> By "dialect", the manual means "language", as in "warning specific to the C++
> language". 

Does it?

> Why it uses the word "dialect" completely escapes to me? 

Because a lot of the options are about dialects. Things that allow more (or
less) than standard C++.

> Feel free
> to propose in gcc@gcc.gnu.org to change the word and see what people think.

We've got this bug already, I'm not subscribed to that list.

> > And: Why isn't it included in -Wall -Wextra -pedantic?
> 
> Because old-style casts are still used everywhere, it is more of a matter of

Even in C++?

> style, and adding new warnings to -Wall -Wextra will break building any project
> that uses -Werror for code that is surely working fine. Users complain about
> this all the time.

Isn't that the consequence of using -Werror? I've got perfectly fine code too
that generates warnings.

> (-pedantic is for GCC specific extensions, so it doesn't apply).


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

* [Bug c++/47700] Warning for C casts in C++
  2011-02-11 16:54 [Bug c++/47700] New: Warning for C casts in C++ olafvdspek at gmail dot com
                   ` (9 preceding siblings ...)
  2011-02-12 13:50 ` olafvdspek at gmail dot com
@ 2011-06-29 19:45 ` redi at gcc dot gnu.org
  2011-06-29 20:00 ` manu at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: redi at gcc dot gnu.org @ 2011-06-29 19:45 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47700

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2011.06.29 19:45:04
     Ever Confirmed|0                           |1

--- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-06-29 19:45:04 UTC ---
why is this still open?  please change the summary to something relevant, since
the requested option exists


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

* [Bug c++/47700] Warning for C casts in C++
  2011-02-11 16:54 [Bug c++/47700] New: Warning for C casts in C++ olafvdspek at gmail dot com
                   ` (10 preceding siblings ...)
  2011-06-29 19:45 ` redi at gcc dot gnu.org
@ 2011-06-29 20:00 ` manu at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: manu at gcc dot gnu.org @ 2011-06-29 20:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47700

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |WORKSFORME

--- Comment #12 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2011-06-29 20:00:25 UTC ---
WORKSFORME using -Wold-style-cast. 

The rest of the discussion is bike-shedding that can go into gcc@gcc.gnu.org.
Suggestions for improving the manual should be sent directly to gcc-patches as
patches.


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

end of thread, other threads:[~2011-06-29 20:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-11 16:54 [Bug c++/47700] New: Warning for C casts in C++ olafvdspek at gmail dot com
2011-02-11 16:59 ` [Bug c++/47700] " pinskia at gcc dot gnu.org
2011-02-11 17:05 ` redi at gcc dot gnu.org
2011-02-11 17:07 ` olafvdspek at gmail dot com
2011-02-11 17:18 ` pinskia at gcc dot gnu.org
2011-02-11 17:28 ` olafvdspek at gmail dot com
2011-02-11 17:42 ` redi at gcc dot gnu.org
2011-02-11 17:43 ` redi at gcc dot gnu.org
2011-02-11 17:49 ` olafvdspek at gmail dot com
2011-02-11 19:56 ` manu at gcc dot gnu.org
2011-02-12 13:50 ` olafvdspek at gmail dot com
2011-06-29 19:45 ` redi at gcc dot gnu.org
2011-06-29 20:00 ` manu at gcc dot gnu.org

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).