Question on const applied to typedef'd pointer

Arthur David Olson ado at elsie.UUCP
Sat Feb 25 11:57:34 AEST 1989


Here's a typescript obtained using the GNU C compiler (version 1.34):

	Script started on Fri Feb 24 20:43:19 1989
	elsie$ cat try.c
1>	const char * const	foo;

	typedef char *		bar;

2>	const bar const		baz;
	elsie$ gcc -c try.c
	try.c:5: warning: duplicate `const'
	elsie$ exit

	script done on Fri Feb 24 20:43:38 1989

The question for the gurus:  should line 1 above have the same meaning as
line 2 above, despite gcc's warning?
-- 
	Arthur David Olson    ado at ncifcrf.gov    ADO is a trademark of Ampex.



More information about the Comp.lang.c mailing list