warning: multi-character character constant

Tim Prince tprince@computer.org
Fri Oct 27 06:31:00 GMT 2000

That's a somewhat obscure feature which has been in C since long before
ANSI/ISO; 'xxxx' is not a null-terminated character string like "xxxx" which
would be stored byte-wise.  It depends on your system being capable of
storing that group of characters in a way similar to that suggested by your
quoted usage, so it's non-portable.  Of course, nowadays, 4 characters are
expected to fit in a long, but there's also the possibility that a string
was meant rather than a multi-character constant.
----- Original Message -----
From: "Valerio Ferrucci" <valfer@flashnet.it>
To: <gcc-bugs@gcc.gnu.org>; <bug-gcc@gnu.org>
Sent: Thursday, October 26, 2000 9:32 AM
Subject: warning: multi-character character constant

> Hi,
> I get always this warning during code compiling:
> warning: multi-character character constant
> in lines like:
> if (*(long*)p == 'xxxx'))
> ...
> What does it mean?
> Thanks for help
> ==================================================================
> Valerio Ferrucci                        Tabasoft Sas
> valfer@flashnet.it                      http://tabasoft.ancitel.it
>                                         taba@flashnet.it

More information about the Gcc-bugs mailing list