Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucsd!hub!6600pete From: 6600pete@ucsbuxa.ucsb.edu Newsgroups: comp.lang.c Subject: Re: Strings in C (Re: ambiguous ?) Message-ID: <2756@hub.UUCP> Date: 27 Oct 89 23:55:15 GMT References: <11398@smoke.BRL.MIL> <14115@lanl.gov> <2522@munnari.oz.au> <6676@ficc.uu.net> <2421@convex.UUCP> <2742@hub.UUCP> <11428@smoke.BRL.MIL> Sender: news@hub.UUCP Reply-To: pete@cavevax.ucsb.edu Organization: Underground BBS: rlogin 128.111.41.100 -l bbs Lines: 30 In-reply-to: gwyn@smoke.BRL.MIL's message of 27 Oct 89 18:37:06 GMT In article <11428@smoke.BRL.MIL> gwyn@smoke.BRL.MIL (Doug Gwyn) writes: > In article <2742@hub.UUCP> pete@cavevax.ucsb.edu writes: >>In article <2421@convex.UUCP> grogers@sushi.uucp (Geoffrey Rogers) writes: >>> In article <6676@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes: >>>>In most Macintosh C compilers that I've seen, the syntax !"%p...."! is >>Actually, the syntax is "\p...", but that's only a nit I had to pick. > Oh, if THAT's the issue, then it's not a problem. Any program containing > a string literal like "\pXXX" has stepped into the Twilight Zone of > "undefined behavior"; the implementation is free to assign a "counted > string" meaning to this if it happens to be useful to do so. Ick. What a mess this makes. Oh well. Actually, from previous articles I've just read, there is apparently a "%p...", but I'm not quite sure why this is a bad thing as long as it is documented correctly. I mean, on a non-Mac compiler, it's not going to be caught anyway. And odds are that you're not going to want to port a truly Mac-ish app anywhere. The first page of Inside Macintosh, the Macker's Bible, says "Everything you know is wrong..." Porting TO the Mac is conceivable; most compilers have relatively extensive "UNIX compatibility" libraries. But code FROM UNIX is not going to have a problem with "\p..." or "%p..." either, is it? The SunOS 4 man pages don't say they use "%p..." for anything (which of course is not the final word, but we're dealing in percentage chances of conflicts, aren't we?) -- | GurgleKat (Pete Gontier), pete@cavevax.ucsb.edu | .UUCP reply addresses bounce; try another path. | ...if you'd gone to Dartmouth, you'd not have had to take the math.