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

Re: dpkg with triggers support (again)

On Wed, Mar 12, 2008 at 11:39:10AM -0500, Steve Greenland wrote:
> On 12-Mar-08, 04:21 (CDT), Pierre Habouzit <madcoder@debian.org> wrote: 
> > Yay for portability: many compilers don't support forward static prototypes
> > properly. And then we hear about using (char *)0 instead of NULL for
> > portability reasons,

> As has been explained, the problem is not replacing "0" with "NULL",
> which should be equivalent in any C89 or C99 compiler, the problem is
> replacing "(char *)0" with "NULL", which is not.

> Claiming it doesn't matter because it works fine on all current Debian
> platforms is no different than those who assumed "sizeof(long) == 4",
> or that pointers and ints were interchangeable. After all, it worked on
> their platform, so why be correct?

I don't claim that it doesn't matter because it works fine on all current
Debian platforms.  I claim that it doesn't matter because it works fine on
all platforms that Samba has been ported to, which apparently includes not
just all Unices ever, but also VMS, QNX, and a couple other oddball archs
that I can't remember.  #defining NULL as 0 instead of (void *)0 or
(char *)0 is more pathological than VMS.  Who cares if dpkg runs on those
systems, when none of the packages you would be installing with dpkg do?

I agree that quibbling over (char *)0 vs. NULL, while using prototypes of
the sort shown, is a terrible double-standard.  Well, or perhaps "standard"
is the key word - while I think (if memory serves) that the prototypes Ian
is using are allowed by C99, using them causes a far greater reduction in
portability than the *non*-standard uses of NULL that Ian is lambasting
Guillem for.

So either Ian is just using his familiarity with the standard as a stick to
beat people with, or, er, I guess he esteems standards-compliance far
above portability.

Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek@ubuntu.com                                     vorlon@debian.org

Reply to: