This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/64531] `casting between pointer-to-function and pointer-to-object` is still a warning instead of error with `-pedantic -pedantic-errors`


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

Harald van Dijk <harald at gigawatt dot nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |harald at gigawatt dot nl

--- Comment #2 from Harald van Dijk <harald at gigawatt dot nl> ---
It's already been fixed.

$ g++-4.8.4 -pedantic -pedantic-errors -c test.cc
test.cc: In function âint main()â:
test.cc:1:33: error: ISO C++ forbids casting between pointer-to-function and
pointer-to-object [-Werror=pedantic]
 int main() { (void(*)())(void *)0; }
                                 ^
cc1plus: some warnings being treated as errors

But the comments in PR 60850 note that this may have been a bad idea (at least
a bad idea for a release branch).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]