OpenSSH -current fails regression on Solaris 8, sshd dumps core
Frank Cusack
fcusack at fcusack.com
Tue Sep 24 16:22:31 EST 2002
On Sun, Sep 22, 2002 at 04:59:30PM -0500, Sam Reynolds wrote:
> On Sat, Sep 21, 2002 at 01:20:19PM -0500, Sam Reynolds wrote:
>
> >No, it isn't. NULL is guaranteed to be a macro expanding to an
> >"unadorned 0".
> I don't believe in C such a guarantee is given.
> 7.17.3 in C99 says:
> "... NULL which expands to an implementation-defined null
> pointer constant..."
> 6.23.2.3.3 explains that a null pointer constant is:
> "An integer constant expression with the value 0, or such
> an expression cast to type void *"
I stand corrected!
> >> and since sprintf is a variadic function, one would
> >> need an explicit cast to the appropriate type.
>
> >No, one doesn't. A variadic function interprets pointers based on the
> >format string, not based on the type given to the compiler.
>
> One does for two reasons. The first being a situation where my format
> string is input from the user, clearly the compiler can't know what the
> args are going to be at compile time.
In which case, how are you going to know what to cast to?
> Second, if I write my own
> variadic function the compiler will not know what the arguments to
> my function are if I don't explicitly cast them (if they are void*).
huh?
/fc
More information about the openssh-unix-dev
mailing list