Re: [PATCHES] remove obsolete NULL casts

2004-01-06 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > Ah, good catch! Upon further investigation, you're completely correct: > technically, you need to cast the NULL literal to a pointer type in a > function call if (a) there is no prototype for the function, or (b) > the function is a varargs function (which

Re: [PATCHES] remove obsolete NULL casts

2004-01-06 Thread Neil Conway
Kurt Roeckx <[EMAIL PROTECTED]> writes: > In src/backend/port/darwin/system.c you replaced: > > execl(_PATH_BSHELL, "sh", "-c", command, (char *) NULL); > > By: > execl(_PATH_BSHELL, "sh", "-c", command, NULL); > > I think that is one of the exceptions where you do have to cast it, > because the ty

Re: [PATCHES] remove obsolete NULL casts

2004-01-05 Thread Kurt Roeckx
On Mon, Jan 05, 2004 at 04:31:40PM -0500, Neil Conway wrote: > In any modern dialect of C, casting the "NULL" pointer literal to a > specific pointer type is unnecessary. For example: > > char *foo; > foo = malloc(...); > if (foo == (char *) NULL) {...} In src/backend/port/darwin/sys

[PATCHES] remove obsolete NULL casts

2004-01-05 Thread Neil Conway
In any modern dialect of C, casting the "NULL" pointer literal to a specific pointer type is unnecessary. For example: char *foo; foo = malloc(...); if (foo == (char *) NULL) {...} The cast on the 3rd line serves no useful purpose. Hence, this patch removes all such instances of NULL-