public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60850] New: pedantic warning behavior when casting void* to ptr-to-func
@ 2014-04-15 18:36 daniel.gutson at tallertechnologies dot com
  2014-04-15 18:53 ` [Bug c++/60850] " redi at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: daniel.gutson at tallertechnologies dot com @ 2014-04-15 18:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60850
           Summary: pedantic warning behavior when casting void* to
                    ptr-to-func
           Product: gcc
           Version: 4.8.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: daniel.gutson at tallertechnologies dot com

Created attachment 32606
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32606&action=edit
proposed fix

#pragma GCC diagnostic ignore "-pedantic"
doesn't work in cases such as:

    void* p = 0;
#pragma GCC diagnostic ignored "-pedantic"
    F* f2 = reinterpret_cast<F*>(p);

I tested the attached patch, and all passes plus the test case I added.

Please consider to add the fix in 4.8.3.
I don't have write access.

Changelog:

2014-03-31  Daniel Gutson  <daniel.gutson@tallertechnologies.com>

gcc/cp/
        * typeck.c (build_reinterpret_cast_1): Pass proper argument to
warn() in pedantic.

gcc/testsuite/g++.dg/
        * diagnostic/pedantic.C: New test case.


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

end of thread, other threads:[~2014-07-28 16:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-15 18:36 [Bug c++/60850] New: pedantic warning behavior when casting void* to ptr-to-func daniel.gutson at tallertechnologies dot com
2014-04-15 18:53 ` [Bug c++/60850] " redi at gcc dot gnu.org
2014-04-15 20:41 ` daniel.gutson at tallertechnologies dot com
2014-04-15 21:09 ` redi at gcc dot gnu.org
2014-04-16  9:11 ` jakub at gcc dot gnu.org
2014-04-16 10:07 ` manu at gcc dot gnu.org
2014-04-22 20:12 ` daniel.gutson at tallertechnologies dot com
2014-07-26  2:37 ` tony at kelman dot net
2014-07-28 16:38 ` tony at kelman dot net

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