According to the standard(§6.4.4.4/ 10)
The value of an integer character constant containing more than one
character (e.g., ‘ab’), […] is implementation-defined.
long x = '\xde\xad\xbe\xef'; // yes, single quotes
这是有效的ISO 9899:2011 C.它在没有警告的情况下使用-Wall编译gcc,并且使用-pedallic编译“多字符字符常量”警告.
从Wikipedia开始:
Multi-character constants (e.g. ‘xy’) are valid, although rarely
useful — they let one store several characters in an integer (e.g. 4
ASCII characters can fit in a 32-bit integer, 8 in a 64-bit one).
Since the order in which the characters are packed into one int is not
specified, portable use of multi-character constants is difficult.
为了便于携带,请不要使用带有整数类型的多字符常量.