[Bug c++/60850] New: pedantic warning behavior when casting void* to ptr-to-func
daniel.gutson at tallertechnologies dot com
gcc-bugzilla@gcc.gnu.org
Tue Apr 15 18:36:00 GMT 2014
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.
More information about the Gcc-bugs
mailing list