On Tue, 16 Feb 2016, Stuart Brady wrote: > > For whether arguments are evaluated, you need __array_size with arguments > > that have side effects, and then test whether those side effects occurred. > > For whether results are integer constant expressions, you can test e.g. > > whether __array_size (a) - __array_size (a) is accepted in a context > > requiring a pointer (whether it acts as a valid null pointer constant). > > With my patch, void *p = __array_size(a) - __array_size(a) sets p to be > null. That behaviour seems desirable to me.
It sets it to be null - but does it diagnose conversion from integer to pointer without a cast (it should do so if __array_size is not evaluating to an integer constant expression, but not if it is evaluating to an integer constant expression - hence this being one way to test whether the result is an integer constant expression)? -- Joseph S. Myers jos...@codesourcery.com