public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: Gerald Pfeifer <gerald@pfeifer.com>
Cc: Joseph Myers <joseph@codesourcery.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] avoid non-printable characters in diagnostics (c/77620, c/77521)
Date: Sun, 01 Jan 2017 21:33:00 -0000	[thread overview]
Message-ID: <e34e797c-8a4d-b049-a095-9601a1b6e0cb@gmail.com> (raw)
In-Reply-To: <alpine.LSU.2.20.1612311507300.2994@anthias.pfeifer.com>

On 12/31/2016 12:08 PM, Gerald Pfeifer wrote:
> On Fri, 9 Sep 2016, Martin Sebor wrote:
>> I mentioned the hex vs octal notation to invite input into which
>> of the two of them people would prefer to see used by the %qc and
>> qs directives, and whether it's worth considering changing the %qE
>> directive to use the same notation as well, for consistency (and
>> to help with readability if there is consensus that one is clearer
>> than the other).
>
> I do think hex is the way to go, and that it would be good to be
> consistent across the board.
>
> (All e-mail alert, but I don't think I saw a response to that.)
>
>> What I meant by ambiguity is for example a string like "\1234"
>> where it's not obvious where the octal sequence ends.  Is it '\1'
>> followed  by "234" or '\12' followed by "34" or '\123' followed
>> by "4"?  (It's only possible to tell if one knows that GCC always
>> uses three digits for the octal character, but not everyone knows
>> that.)
>
> Agreed.  And octal notation is just not very common today, too,
> I'd argue.

Thanks.  I think the thread petered out after that and I didn't
remember to get back to it and the still outstanding %qE problem
where GCC uses the octal base and doesn't convert the character
values to unsigned char, resulting in confusing output like that
below:

$ echo 'constexpr int i = "\x80";' | gcc -S -Wall -Wextra -xc++ -
<stdin>:1:19: error: invalid conversion from ‘const char*’ to ‘int’ 
[-fpermissive]
<stdin>:1:19: error: ‘(int)((const char*)"\37777777600")’ is not a 
constant expression

(The still unconfirmed bug 77573 came out of my tests of the fix
for the related bugs in the subject and tracks the wide character
part of the problem.)

Martin

  parent reply	other threads:[~2017-01-01 21:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-09  4:10 Martin Sebor
2016-09-09 14:00 ` Joseph Myers
2016-09-10  0:07   ` Martin Sebor
2016-09-16 16:57     ` Jeff Law
     [not found]     ` <alpine.LSU.2.20.1612311507300.2994@anthias.pfeifer.com>
2017-01-01 21:33       ` Martin Sebor [this message]
2016-09-16 17:00 ` Jeff Law

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=e34e797c-8a4d-b049-a095-9601a1b6e0cb@gmail.com \
    --to=msebor@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gerald@pfeifer.com \
    --cc=joseph@codesourcery.com \
    /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: link
Be 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).