Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Spurious diagnostic messages Date: Fri, 29 May 2015 10:52:41 -0700 Organization: None to speak of Lines: 27 Message-ID: <871thzl192.fsf@kst-u.example.com> References: <7af4f97c-d5f3-4bbd-ab6b-6c5b677fa880@googlegroups.com> <556052c8.7856531@news.xs4all.nl> <871ti6rawv.fsf@kst-u.example.com> <3qh2ma1vojvb0add103h8tabbcb5gedhhb@4ax.com> <87pp5mevxn.fsf@bsb.me.uk> <55685ac3.14685515@news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="9be37d943435275679235b07c7947eef"; logging-data="6485"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+zEFNaXwJWld3mXhBV/0s5" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:vFiilMOS1fb9IvopiX/8UutNG5c= sha1:6IeABQGVjMrLKJ+kF918NAu8vP4= Xref: csiph.com comp.lang.c:62801 Bartc writes: [...] > (What /does/ suit C more is something like: > > int permutation; > > switch (permutation) { > case 'ABC': > case 'ACB': > etc. > > Except that such char literals are probably badly defined, and with > Unicode becoming popular, that introduces problems.) 'ABC' is already a valid character constant. It has type int and an implementation-defined value. (With gcc on my system, its value is ('A'<< 16) + ('B' << 8) + 'C'). It's a feature that I've seen used incorrectly far more often than it's been used correctly -- and it pretty much *can't* be used correctly in portable code. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"