On Thu, 9 Aug 2007, DJ Delorie wrote:

> 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.

I don't know about using reference types, but there are several math
builtins that "return" multiple values, the extra ones via pointer
arguments.  E.g. see frexp, lgamma_r, modf, remquo and/or sincos.

                --Kaveh
--
Kaveh R. Ghazi                  [EMAIL PROTECTED]

Reply via email to