Mismatched types in ADDR_EXPR from c-typeck.c:build_function_call
Gabriel Dos Reis
gdr@integrable-solutions.net
Wed May 18 15:11:00 GMT 2005
"Joseph S. Myers" <joseph@codesourcery.com> writes:
| On Wed, 18 May 2005, Richard Guenther wrote:
|
| > The following snippet
| >
| > /* Differs from default_conversion by not setting TREE_ADDRESSABLE
| > (because calling an inline function does not mean the function
| > needs to be separately compiled). */
| > fntype = build_type_variant (TREE_TYPE (function),
| > TREE_READONLY (function),
| > TREE_THIS_VOLATILE (function));
| > fundecl = function;
| > function = build1 (ADDR_EXPR, build_pointer_type (fntype),
| > function);
|
| If you want to avoid this then you need to arrange for const and noreturn
| attributes on functions always to be represented by qualifiers on the type
| and not on the decl. This is part of bug 3481.
|
| (a) Change handle_noreturn_attribute and handle_const_attribute to put the
| qualifiers on the type in addition to the decl. This might be all you
if you're doing that and that code at some point would be used by the
C++ front-end, then you need to be very very careful because that is a
very sensitive area for C++ -- especially for the type of address of
functions, template argument deduction and the like.
-- Gaby
More information about the Gcc
mailing list