I'm running GCC 3.2 for cygwin and mingw32, using the latest binary distributions available. When compiling this code I get the error message: test.cpp:7: invalid conversion from `void (*)()' to `void (*)()' which omits the calling convention in the target type, resulting in a very interesting error message. My Testcase: typedef void (__attribute__((__stdcall__)) *FooFuncType)(); void TakesAFoo(FooFuncType TheFoo); void MyFoo(); int main() { TakesAFoo(MyFoo); } I built it with: g++ -c test.cpp Cygwin reports with -v: Configured with: /netrel/src/gcc-3.2-3/configure --enable- languages=c,c++,f77,java --enable-libgcj --enable-threads=posix --with-system- zlib --enable-nls --without-included-gettext --enable-interpreter --disable- sjlj-exceptions --disable-version-specific-runtime-libs --enable-shared -- build=i686-pc-linux --host=i686-pc-cygwin --target=i686-pc-cygwin --enable- haifa --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib -- includedir=/nonexistent/include --libexecdir=/usr/sbin
Just for the records: I think there is another PR about this, but I can't find it right now. W.
I can confirm this on the mainline (20031108).
Author: ktietz Date: Mon Mar 21 08:29:36 2011 New Revision: 171209 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171209 Log: ChangeLog gcc/ 2011-03-21 Kai Tietz <ktietz@redhat.com> PR target/12171 * doc/plugins.texi: Adjust documentation for plugin register_callback. * tree.h (attribute_spec): Add new member affects_type_identity. - Zitierten Text anzeigen - * attribs.c (empty_attribute_table): Adjust attribute_spec initializers. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/crx/crx.c: Likewise. * config/darwin.h: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/cygming.h: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68hc11/m68hc11.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep.c: Likewise. * config/microblaze/microblaze.c: Likewise. * config/mips/mips.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/sh/sh.c: Likewise. * config/sol2.h: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/v850/v850.c: Likewise. ChangeLog gcc/cp 2011-03-21 Kai Tietz <ktietz@redhat.com> PR target/12171 * tree.c (cxx_attribute_table): Adjust table. ChangeLog gcc/testsuite 2011-03-21 Kai Tietz <ktietz@redhat.com> PR target/12171 * g++.dg/plugin/attribute_plugin.c: Adjust test. ChangeLog gcc/java 2011-03-21 Kai Tietz <ktietz@redhat.com> PR target/12171 * lang.c (java_attribute_table): Adjust table. ChangeLog gcc/lto 2011-03-21 Kai Tietz <ktietz@redhat.com> PR target/12171 * lto-lang.c (lto_attribute_table): Adjust table. ChangeLog gcc/ada 2011-03-21 Kai Tietz <ktietz@redhat.com> PR target/12171 * gcc-interface/utils.c (gnat_internal_attribute_table): Add new element. ChangeLog gcc/c-family 2011-03-17 Kai Tietz PR target/12171 * c-common.c (c_common_attribute_table): Add new element. (c_common_format_attribute_table): Likewise. Modified: trunk/gcc/ChangeLog trunk/gcc/ada/ChangeLog trunk/gcc/ada/gcc-interface/utils.c trunk/gcc/attribs.c trunk/gcc/c-family/ChangeLog trunk/gcc/c-family/c-common.c trunk/gcc/config/alpha/alpha.c trunk/gcc/config/arc/arc.c trunk/gcc/config/arm/arm.c trunk/gcc/config/avr/avr.c trunk/gcc/config/bfin/bfin.c trunk/gcc/config/crx/crx.c trunk/gcc/config/darwin.h trunk/gcc/config/h8300/h8300.c trunk/gcc/config/i386/cygming.h trunk/gcc/config/i386/i386.c trunk/gcc/config/ia64/ia64.c trunk/gcc/config/m32c/m32c.c trunk/gcc/config/m32r/m32r.c trunk/gcc/config/m68hc11/m68hc11.c trunk/gcc/config/m68k/m68k.c trunk/gcc/config/mcore/mcore.c trunk/gcc/config/mep/mep.c trunk/gcc/config/microblaze/microblaze.c trunk/gcc/config/mips/mips.c trunk/gcc/config/rs6000/rs6000.c trunk/gcc/config/rx/rx.c trunk/gcc/config/sh/sh.c trunk/gcc/config/sol2.h trunk/gcc/config/sparc/sparc.c trunk/gcc/config/spu/spu.c trunk/gcc/config/stormy16/stormy16.c trunk/gcc/config/v850/v850.c trunk/gcc/cp/ChangeLog trunk/gcc/cp/tree.c trunk/gcc/doc/plugins.texi trunk/gcc/java/ChangeLog trunk/gcc/java/lang.c trunk/gcc/lto/ChangeLog trunk/gcc/lto/lto-lang.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/plugin/attribute_plugin.c trunk/gcc/tree.h
Author: ktietz Date: Mon Mar 21 08:32:50 2011 New Revision: 171210 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171210 Log: ChangeLog gcc/c-family 2011-03-21 Kai Tietz <ktietz@redhat.com> PR target/12171 * c-pretty-print.c (pp_c_specifier_qualifier_list): Display allowed attributes for function pointer types. (pp_c_attributes_display): New function to display attributes having affects_type_identity flag set to true. * c-pretty-print.h (pp_c_attributes_display): New prototype. ChangeLog gcc/cp 2011-03-21 Kai Tietz <ktietz@redhat.com> PR target/12171 * cxx-pretty-print.c (pp_cxx_ptr_operator): Display allowed attributes for function pointer types. * error.c (dump_type_prefix): Likewise. Modified: trunk/gcc/c-family/ChangeLog trunk/gcc/c-family/c-pretty-print.c trunk/gcc/c-family/c-pretty-print.h trunk/gcc/cp/ChangeLog trunk/gcc/cp/cxx-pretty-print.c trunk/gcc/cp/error.c
Fixed on trunk (4.7)