[systemd-devel] [bug] (char*)NULL should be used in variadic functions
lennart at poettering.net
Mon Feb 4 02:15:15 PST 2013
On Wed, 30.01.13 11:07, Vasily Kulikov (segoon at openwall.com) wrote:
> systemd uses plain NULL as an argument of variadic functions, which is a
> UB in C. (char*)NULL should be used instead. Plain NULL may be defined
> as "0" or smth.
> >From C99:
> "22.214.171.124 Pointers
> An integer constant expression with the value 0, or such an expression
> cast to type void *, is called a null pointer constant.
> 7.17 Common definitions <stddef.h>
> The macros are NULL which expands to an implementation-defined null
> pointer constant;"
> NULL is wrongly used e.g. in sd_journal_send() in
We actually care about readability of the sources and non-Linux systems
are out-of-focus for us. Can you tell me which Linux system has
sizeof(void*) != sizeof(char*)? Otherwise, I only see this as pointless
excercise of making our sources less readable...
Or am I missing something here?
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel