This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/8680] g++ doesn't warn when passing a C++ funcptr instead of extern "C" funcptr
- From: "dbaron at dbaron dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Aug 2005 04:33:14 -0000
- Subject: [Bug c++/8680] g++ doesn't warn when passing a C++ funcptr instead of extern "C" funcptr
- References: <20021122091602.8680.apm35@student.open.ac.uk>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dbaron at dbaron dot org 2005-08-20 04:33 -------
As I wrote in https://bugzilla.mozilla.org/show_bug.cgi?id=81385#c9 :
Looking at the C++ standard (the out-of-date 1998 version, I admit), as far as I
can tell a conformant compiler is required to give a diagnostic for this. In
particular, section 7.5 [dcl.link] clause 1 says that function types with
different linkage are different types, section 4 [conv] does not describe any
standard conversions that could convert between them, and section 5.2.2
[expr.call] clause 4 and section 8.5 [dcl.init] clauses 12 and 14 seem to
require that such a conversion exist.
In particular, the last says that the conversion is ill-formed, which 1.4
[intro.compliance] says requires a diagnostic.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |dbaron at dbaron dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8680