noalias comments to X3J11

Frank Swarbrick swarbric at tramp.Colorado.EDU
Tue Mar 22 11:22:24 AEST 1988


What does this const thing have to do with the function below getting the
suspicious pointer conversion warning?

int pos(const char *str,char c)
{
 char *s;
 
 s = strchr(str,c);
 return s ? (int)(s - str) : -1;
}

This, of course, works if I take out the const thing.  Is this one of the
things that you were complaining about, or should this just plain not work?
(This was done in Turbo C 1.5, by the way.)

Frank Swarbrick (and his cat)
swarbric at tramp.UUCP               swarbric at tramp.Colorado.EDU
...!{ncar|nbires}!boulder!tramp!swarbric
"Welcome back my friends to the show that never ends..."



More information about the Comp.lang.c mailing list