Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!mcnc!rti!sas!toebes From: toebes@sas.UUCP (John Toebes) Newsgroups: comp.sys.amiga Subject: Re: Don't forget the comma Summary: String concatenation is an ANSI feature Message-ID: <662@sas.UUCP> Date: 23 Oct 88 18:42:25 GMT References: <8810192323.AA21251@jade.berkeley.edu> Reply-To: toebes@sas.UUCP (John Toebes) Organization: SAS Institute Inc, Cary NC Lines: 26 In article <8810192323.AA21251@jade.berkeley.edu> writes: >[] >Has anyone else run into this "feature" of Manx C? >It happens with both 3.4b and 3.6a (at least, the ones I have). >Minimal case - > >char *array[] = { "s1" "s2" }; > >That's it. >Now, it seems obvious to me (and every other compiler I >have used) that this is a syntax error. But the Manx compiler never even >burps. What it does do is concat "s1" and "s2" into "s1s2" and put just the >one pointer into array. The automatic concatenation of strings is a feature that has been introduced by the ANSI comittee. It is actually quite useful when you want to do something like: #define CSI "\x9B" #define EEOL CSI "K" printf(EEOL "This is a string" ); With the ANSI standard recently voted out, expect to see more compilers performing this type of operation, not less. /*---------------------All standard Disclaimers apply---------------------*/ /*----Working for but not officially representing SAS or Lattice Inc.-----*/ /*----John A. Toebes, VIII usenet:...!mcnc!rti!sas!toebes-----*/ /*------------------------------------------------------------------------*/