[systemd-devel] [bug] (char*)NULL should be used in variadic functions

Lennart Poettering lennart at poettering.net
Mon Feb 4 11:22:23 PST 2013

On Mon, 04.02.13 11:37, Michał Bartoszkiewicz (mbartoszkiewicz at gmail.com) wrote:

> On Mon, Feb 4, 2013 at 11:15 AM, Lennart Poettering
> <lennart at poettering.net> wrote:
> > 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?
> I believe it is legal (but glibc doesn't seem to do it) to define NULL
> simply as 0, so sizeof NULL == sizeof(int), which can be different
> from sizeof(void*).

Be that as it may, for us only Linux is relevant, and that implies glibc
(or some other implementation of libc that implements the very same


Lennart Poettering - Red Hat, Inc.

More information about the systemd-devel mailing list