Is there a standard prototype for `execvp'?
Henry Spencer
henry at zoo.toronto.edu
Tue Feb 5 06:39:21 AEST 1991
Submitted-by: henry at zoo.toronto.edu (Henry Spencer)
In article <17574 at cs.utexas.edu> donn at hpfcrn.fc.hp.com (Donn Terry) writes:
> int execvp (const char *file, char *const argv[]);
>
>It was generally agreed during balloting that what really was wanted
>was "const char * const argv[]". However, ANSI C disagrees: that's
>a syntax error!
This puzzled me a bit, since that is *not* a syntax error, but a bit of
private correspondence with Donn cleared it up. The problem is not that
the declaration is illegal, but that `char *[]' and `const char *const []'
are not assignment-compatible -- the "inner" const does not magically get
ignored like the "outer" one -- so this would break backward compatibility.
--
"Maybe we should tell the truth?" | Henry Spencer at U of Toronto Zoology
"Surely we aren't that desperate yet." | henry at zoo.toronto.edu utzoo!henry
Volume-Number: Volume 22, Number 106
More information about the Comp.std.unix
mailing list