public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "h dot b dot furuseth at usit dot uio dot no" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/29455] Issues with -Wchar-subscripts Date: Sat, 14 Oct 2006 17:53:00 -0000 [thread overview] Message-ID: <20061014175253.27245.qmail@sourceware.org> (raw) In-Reply-To: <bug-29455-1038@http.gcc.gnu.org/bugzilla/> [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 1700 bytes --] ------- Comment #3 from h dot b dot furuseth at usit dot uio dot no 2006-10-14 17:52 ------- Subject: Re: Issues with -Wchar-subscripts Sorry about the empty answer. pinskia at gcc dot gnu dot org writes: > 'a' in C is not of the type char but instead int so not warning there > is correct really. Hmm, yes, it fits the documentation. I guess what I'm asking is for a change in the warning's spec. array['8-bit char'] is almost certainly wrong in an iso646-derived charset, since for a portable program the programmer can't know if the index is positive or negative. I don't know if enough information is available in C at the time the warning is given do do that, though. > Also you forgot one thing '%' does not have to match up with the ANSI > character set so it could be negative in signed char which means char > (which could default to signed char) would be different. No. In a conforming C implementation, the character *which C interprets as '%'* must have a positive value. Maybe you are thinking of the opposite case: What its glyph _looks like_ on some display device is out of scope for the C standard. In the 7-bit days we had screens with the Norwegian charset NS_4551-1, but the C compiler (like most of the American-made computer) thought it received ASCII. Thus we had to write main() æ printf("Hello, world!Øn"); return 0; å for the ASCII compiler to see main() { printf("Hello, world!\n"); return 0; } The ANSI Rationale blessed this behavior since it already was common (and more readable than trigraphs), the example there was the Yen sign. I can probably dig it up if you are interested. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29455
next prev parent reply other threads:[~2006-10-14 17:53 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2006-10-13 12:51 [Bug c++/29455] New: " h dot b dot furuseth at usit dot uio dot no 2006-10-13 16:54 ` [Bug c++/29455] " pinskia at gcc dot gnu dot org 2006-10-14 17:06 ` h dot b dot furuseth at usit dot uio dot no 2006-10-14 17:53 ` h dot b dot furuseth at usit dot uio dot no [this message] 2006-10-14 18:08 ` Andrew Pinski 2006-10-14 18:08 ` pinskia at gmail dot com 2006-10-17 12:49 ` h dot b dot furuseth at usit dot uio dot no 2006-10-24 6:32 ` gdr at integrable-solutions dot net 2006-10-24 8:20 ` h dot b dot furuseth at usit dot uio dot no [not found] <bug-29455-4@http.gcc.gnu.org/bugzilla/> 2012-04-17 22:26 ` manu at gcc dot gnu.org 2015-01-08 11:56 ` preston at bannister dot us
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20061014175253.27245.qmail@sourceware.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).