Newsgroups: comp.lang.c
Path: utzoo!utgpu!watserv1!watmath!datangua
From: datangua@watmath.waterloo.edu (David Tanguay)
Subject: Re: Is this a valid ANSI program?
Message-ID: <1991Jun26.232121.29755@watmath.waterloo.edu>
Organization: University of Waterloo
References: <609@mtndew.Tustin.CA.US>
Date: Wed, 26 Jun 1991 23:21:21 GMT
Lines: 28

In article <609@mtndew.Tustin.CA.US> friedl@mtndew.Tustin.CA.US (Stephen J. Friedl) writes:
>	void foo(const char **xxx)
>	{
>		/* nothing */
>	}
>
>	main()
>	{
>	char	**p = 0;
>
>		foo(p);
>	}
>
>The compiler claims that the argument /p/ to the function foo()
>is incompatible with the prototype, and I just don't believe it.

I don't believe it, either. In 3.3.16.1, Simple Assignment, Constraints:
	both operands are pointers to qualified of unqualified versions
	of compatible types, and the type pointed to by the left has all
	the qualifications of the type pointed to by the right

Your code satisfies this constraint (the others don't pertain to the example).
If you remove one level of indirection, you have a very common situation,
with the way the library routines are declared.
E.g., int printf( const char *, ... )
-- 
David Tanguay                  datanguay@watmath.waterloo.edu
Thinkage, Ltd.                 dat@Thinkage.On.CA
