const applied to typedef'd pointer + const functions

Maarten Litmaath maart at cs.vu.nl
Fri Mar 3 06:44:03 AEST 1989


karl at haddock.ima.isc.com (Karl Heuer) writes:
\After `typedef char *string',
\`string const x' means `char * const x' rather than `char const * x'.

Of course. But I was talking of `const string x'; in my opinion this should
mean `const char *x'. ADO's example `const string const x' should translate to
`const char * const x'. I guess the problem is the equivalence of `const char'
and `char const', which - generalized - leads to `const string' ==
`string const'. This equivalence is dubious, or?

BTW, how about letting `const double sin(double)' mean
"sin() is a `true' function"? (`true': same args -> same result [i.e. no
side-effects])
-- 
 "Those who do not understand Henry     |Maarten Litmaath @ VU Amsterdam:
Spencer are condemned to reinvent DOS." |maart at cs.vu.nl, mcvax!botter!maart



More information about the Comp.lang.c mailing list