Path: utzoo!attcan!uunet!husc6!ukma!gatech!mcnc!rti!sas!toebes From: toebes@sas.UUCP (John Toebes) Newsgroups: comp.sys.amiga Subject: Re: Bug in Lattice 5.0? Summary: No, a difference caused by ANSI Message-ID: <723@sas.UUCP> Date: 28 Nov 88 14:47:05 GMT References: <5668@louie.udel.EDU> Reply-To: toebes@sas.UUCP (John Toebes) Organization: SAS Institute Inc, Cary NC Lines: 26 In article <5668@louie.udel.EDU> AXDRW%ALASKA.BITNET@cunyvm.cuny.edu (Don R. Withey) writes: >I found something interesting today while running an old project through >the new Lattice 5.0 compiler. > > AltColor = "\x9B0;33m" > >When I use this say in {printf("%s\n", AltColor);} I get a warning: >"Warning 121: Hex constant too large for char (high bits will be lost)" >Is this a bug, or am I getting bitten by another difference due to ANSI? This is brought to you compliments of ANSI. They state that any number of hexadecimal digits may appear after the \x and that there is no terminator sequence that you can use to stop it. The alternative suggested for this is: AltColor = "\x9B" "0;33m" Or in a manner that is much more readable, #define CSI "\x9B" AltColor = CSI "0;33m" You should note that even the message is there to catch the ANSI problem althought it continues to work like the 4.01 compiler did UNLESS you specify the ANSI (-ca) switch). >Don R Withey BITNET: AXDRW@ALASKA.BITNET /*---------------------All standard Disclaimers apply---------------------*/ /*----Working for but not officially representing SAS or Lattice Inc.-----*/ /*----John A. Toebes, VIII usenet:...!mcnc!rti!sas!toebes-----*/ /*------------------------------------------------------------------------*/