News for hackers. Stuff that matters.
Re:C++ Annotations by minipci1321 on Saturday November 24, 2018 @02:48AM (#18520980)
> ... when you pass NULL to a varargs function. Instead of passing in a null pointer, the compiler may instead pass in an integer zero.

How can that happen? If I recall the standard, variadic functions have default promotion of non-declared args: integral promotion for integral types, floats to doubles. Why would the compiler want to convert a pointer (which (void*)0 is) to an integer?

Re:C++ Annotations by taejo on Saturday November 24, 2018 @04:49AM (#18521289)
> a pointer (which (void* )0 is)

In C: the macro NULL is an implementation-defined null pointer constant, which may be

> an integer constant expression with the value ​0​

> an integer constant expression with the value 0 cast to the type void*

In C++: the macro NULL is an implementation-defined null pointer constant, which may be

> an integral constant expression rvalue of integer type that evaluates to zero (until C++11)

> an integer literal with value zero, or a prvalue of type std::nullptr_t (since C++11)