On 2007-07-26 15:43:07 +0200, Michael Kerrisk wrote:
> By the way, note the following in the spec of <stddef.h>:
> 
> 11296  CX  NULL Null pointer constant. The macro shall expand to an integer 
> constant expression +
> 11297      with the value 0 cast to type void *.

Yes, "The macro shall expand to an integer constant expression with
the value 0 cast to type void *" was not in Issue 6. Now, note that
the type of a null pointer is not necessarily void *, and a null
pointer is not necessarily constant! So, if you say NULL instead
of "null pointer", the behavior remains unspecified if the pointer
is null and not constant. Remember that the C standard allows to
implement functions of the standard library as macros, so that an
implementation may be able to do the difference between a constant
value and a non-constant value, something in this style:

#define mpfr_cmp_ui(_f,_u)                 \
 (__builtin_constant_p (_u) && (_u) == 0 ? \
   mpfr_sgn (_f) :                         \
   mpfr_cmp_ui_2exp ((_f),(_u),0))

(this is taken from the MPFR source code, but this is just to show
you the possible implications).

-- 
Vincent Lefèvre <[EMAIL PROTECTED]> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)

Reply via email to