DJ Delorie writes:
>extern int U();
>void *ra;
...
>  foo((ra + U()) - 1)
...
>1. What are the language rules controlling this expression, and do they
>have any say about signed vs unsigned wrt the int->pointer promotion?

There is no integer to pointer promotion.  You're adding an integer to a
pointer and then subtracting an integer from the resulting pointer value.
If U() returns zero then the pointer passed to foo() should point to
the element before the one that ra points to.  Well, it should if ra
actually had a type that Standard C permitted using pointer arithmetic on.

                                                Ross Ridge

Reply via email to