L
Luca Forlizzi
Hello,
today I noticed that passing a null constant pointer as argument to a
function
called with no prototype visible, in corrispondence of a pointer
parameter, is undef.b.
This is because when no prototype is visible the argument should be
compatible with
the parameter, and the "null constant pointer" is really an integer
expression.
Is that right?
If so, isn't there a difference between the case where the null
constant pointer
is defined as 0 and the one where it is defined as (void *)0 ? It
seems to me that
if the parameter has type void *, in the formed case there is
unde.b., while in the
latter the behavior is defined.
In case what I wrote above is true, are there real implementations
where it
does not work ?
(I imagine that in implementations pre-prototypes, passing a
null constant pointer does work)
Luca Forlizzi
today I noticed that passing a null constant pointer as argument to a
function
called with no prototype visible, in corrispondence of a pointer
parameter, is undef.b.
This is because when no prototype is visible the argument should be
compatible with
the parameter, and the "null constant pointer" is really an integer
expression.
Is that right?
If so, isn't there a difference between the case where the null
constant pointer
is defined as 0 and the one where it is defined as (void *)0 ? It
seems to me that
if the parameter has type void *, in the formed case there is
unde.b., while in the
latter the behavior is defined.
In case what I wrote above is true, are there real implementations
where it
does not work ?
(I imagine that in implementations pre-prototypes, passing a
null constant pointer does work)
Luca Forlizzi