Multibyte character constants????

Doug Gwyn gwyn at smoke.BRL.MIL
Sun Jul 1 12:18:08 AEST 1990


In article <1824 at tkou02.enet.dec.com> diamond at tkou02.enet.dec.com (diamond at tkovoa) writes:
>In article <1990Jun28.221927.6823 at idt.unit.no> arnej at solan1.solan.unit.no writes:
>>We have stumbled across the subject of multibyte character
>>constants.  Is this defined anywhere?
>Exactly the opposite.  The standard did not even just leave it undefined
>by saying nothing.  The standard explicitly says that it's undefined.

Please do not provide incorrect information like that.

What the C standard actually says is:
	The value of an integer character constant containing more
	than one character, or containing a character or escape
	sequence not represented in the basic execution character
	set, is implementation-defined.

If you don't know the difference in meaning between "implementation-
defined" and "explictly ... undefined", then you should not be trying
to interpret the standard for others.

>>For example, if we say
>>main(){printf("%d\n",'AB');}
>>what should the output be?
>It does not have to compile.  It does not have to execute.  It it does,
>it can print anything, or exec rogue.

Apart from nonconformance introduced by using printf() without having
#included <stdio.h>, and of failing to return a value for the main()
function, the program would be a correct, conforming program that a
conforming implementation would be obliged to compile and do something
useful for when the program is executed.  The specific output obtained
from executing the program would depend on factors that a conforming
implementation is obliged to document.



More information about the Comp.std.c mailing list