Hex escapes in strings

Ray Dunn ray at micomvax.UUCP
Tue Jan 19 09:51:35 AEST 1988


In article <7021 at brl-smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>
>Note that long hex escapes are intended for non-portable usage,
>primarily in multi-byte character set environments, although they
>are useful on unusual architectures having chars > 8 bits.
>

I was going to try to make this reponse witty, but it's too late in the day..

This Doug, seems to me either idiocy or arrogance, someone please tell me
which, or is the above statement included in the Semantics section of the
description of hex escapes in string constants, so I can ensure I'm using them
as the committee intended.

The unfortunate thing is, string constants are not just used for messages
etc, but as arrays of 8-bit data.  These often contain hex constants.  These
hex constants are often followed by hex digits.  So, not only do we have a
major existing code breaking problem, but also another example
of the verbosity being added to C (having to concatenate strings to avoid
the hex problem).  We can write "ABC\x12H... but must remember to write
"ABC\x12""F...  Great!

What is the expression about being committee'd to death?

Ray Dunn.   ..philabs!micomvax!ray



More information about the Comp.lang.c mailing list