bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Test for getaddrinfo() broken on Tru64 UNIX 5.1


From: Ben Pfaff
Subject: Re: Test for getaddrinfo() broken on Tru64 UNIX 5.1
Date: Sat, 13 Oct 2007 13:18:06 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Simon Josefsson <address@hidden> writes:

> On platforms where integers aren't the same size as pointers, things can
> go wrong if 1) you pass 0 to a function that expects a pointer and no
> function prototype was available during compilation, or 2) you pass it
> to a function that takes a variable parameter list.  So it is a good
> habit to use NULL for pointers.

ISO C says that NULL can be defined as 0, without a cast to void
*, and it is always defined that way in C++.  So it is best to
write null pointers in the circumstances you mention as 0 or NULL
cast to the proper pointer type.
-- 
Ben Pfaff 
http://benpfaff.org





reply via email to

[Prev in Thread] Current Thread [Next in Thread]