need help with builtin function prototypes
DJ Delorie
dj@redhat.com
Thu Aug 9 21:30:00 GMT 2007
Could someone provide a hint for me? I'm trying to put in "real"
prototypes for a builtin function where the arguments don't follow the
default promotion rules. Specifically, one of the arguments is a
reference type (like C++'s "int&"). However, I'm bumping into two
problems:
1. The compiler emits a compatibility warning:
dj.c:4: warning: incompatible implicit declaration of built-in function 'mep_and'
2. The compiler seems to be using the implicit declaration instead of
the builtin one, resulting in the builtin's arguments being
incorrect, especially when optimizing:
dj.c:4: error: non-lvalue passed to argument 1 of `mep_and'
Is there a trick to this? I need this type of functionality because
some builtins modify multiple values, so a simple return value is
insufficient, plus this worked with older versions of gcc so our users
are used to it syntax-wise.
Parameters:
<reference_type 0xb7ee3680
type <integer_type 0xb7e922d8 int public SI
size <integer_cst 0xb7e82228 constant invariant 32>
unit size <integer_cst 0xb7e82060 constant invariant 4>
align 32 symtab 0 alias set -1 canonical type 0xb7e922d8 precision 32 min <integer_cst 0xb7e821e0 -2147483648> max <integer_cst 0xb7e821f8 2147483647>
pointer_to_this <pointer_type 0xb7e9b9c0> reference_to_this <reference_type 0xb7ee3680>>
unsigned SI size <integer_cst 0xb7e82228 32> unit size <integer_cst 0xb7e82060 4>
align 32 symtab 0 alias set -1 canonical type 0xb7ee3680>
<integer_type 0xb7e922d8 int public SI
size <integer_cst 0xb7e82228 type <integer_type 0xb7e92068 bit_size_type> constant invariant 32>
unit size <integer_cst 0xb7e82060 type <integer_type 0xb7e92000 unsigned int> constant invariant 4>
align 32 symtab 0 alias set -1 canonical type 0xb7e922d8 precision 32 min <integer_cst 0xb7e821e0 -2147483648> max <integer_cst 0xb7e821f8 2147483647>
pointer_to_this <pointer_type 0xb7e9b9c0>>
Implicit function:
<function_type 0xb7eec618
type <integer_type 0xb7ee02d8 int public SI
size <integer_cst 0xb7ed0228 constant invariant 32>
unit size <integer_cst 0xb7ed0060 constant invariant 4>
align 32 symtab 0 alias set -1 canonical type 0xb7ee02d8 precision 32 min <integer_cst 0xb7ed01e0 -2147483648> max <integer_cst 0xb7ed01f8 2147483647>
pointer_to_this <pointer_type 0xb7ee99c0> reference_to_this <reference_type 0xb7f31680>>
HI
size <integer_cst 0xb7ed0198 type <integer_type 0xb7ee0068 bit_size_type> constant invariant 16>
unit size <integer_cst 0xb7ed01b0 type <integer_type 0xb7ee0000 unsigned int> constant invariant 2>
align 16 symtab 0 alias set -1 structural equality>
Explicit function:
<function_type 0xb7f316e8
type <void_type 0xb7ee95b0 void VOID
align 8 symtab 0 alias set -1 canonical type 0xb7ee95b0
pointer_to_this <pointer_type 0xb7ee9618>>
HI
size <integer_cst 0xb7ed0198 type <integer_type 0xb7ee0068 bit_size_type> constant invariant 16>
unit size <integer_cst 0xb7ed01b0 type <integer_type 0xb7ee0000 unsigned int> constant invariant 2>
align 16 symtab 0 alias set -1 structural equality
arg-types <tree_list 0xb7f34870
value <reference_type 0xb7f31680 type <integer_type 0xb7ee02d8 int>
unsigned SI
size <integer_cst 0xb7ed0228 constant invariant 32>
unit size <integer_cst 0xb7ed0060 constant invariant 4>
align 32 symtab 0 alias set -1 canonical type 0xb7f31680>
chain <tree_list 0xb7f34858 value <integer_type 0xb7ee02d8 int>>>>
More information about the Gcc
mailing list