Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: noalias comments to X3J11 Message-ID: <1988Mar23.193330.459@utzoo.uucp> Organization: U of Toronto Zoology References: <7753@alice.UUCP>, <4993@sigi.Colorado.EDU> Date: Wed, 23 Mar 88 19:33:30 GMT >What does this const thing have to do with the function below getting the >suspicious pointer conversion warning? > > return s ? (int)(s - str) : -1; You're mixing two separate types of pointer: s is char *, str is const char *. THOSE ARE NOT THE SAME TYPE. Evidently the compiler is doing the conversion for you, but it's not entirely happy about it. In this particular case, adding const to the declaration of s would fix it, pretty much. (The exact rules for this sort of thing may yet change again before ANSI C is final.) -- "Noalias must go. This is | Henry Spencer @ U of Toronto Zoology non-negotiable." --DMR | {allegra,ihnp4,decvax,utai}!utzoo!henry