From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109936 invoked by alias); 1 Jan 2017 21:33:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 109919 invoked by uid 89); 1 Jan 2017 21:33:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qt0-f195.google.com Received: from mail-qt0-f195.google.com (HELO mail-qt0-f195.google.com) (209.85.216.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 01 Jan 2017 21:33:43 +0000 Received: by mail-qt0-f195.google.com with SMTP id 41so29692142qtn.0 for ; Sun, 01 Jan 2017 13:33:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=5IAt8JXvj0PBioNck8xydkDqeyXHaQ1bMannB6I/HeU=; b=YpYBgdm/udxdO/VCNupeYv+nynObpc1CA66s1pej1ZXZEh6bStLbDfsGJmlrbZIlvJ MH45Qp2Bi7wKJ27bcrvniTg9J98YaqGyOFvb3dAB8GBkcjEol0SlTA84X+YEm/en3Gzs i4KuZb2AyF9TultnHururhZXmIXewnThqqIjaJZaH4bRrSphrvjgrWYeBYgjx6cKzeJS 592ba2L7JUVkY7PxPOiWRMJlDZsI1M9TZNi0pE2ieFyKb4hD5qy+faHPT3s8s+xRllbH UowvBCVNdaMlWQWePgKZjnJCD9Vn7CYR1ddr4X4auSabue93lME7Li2PmpD4A9NSKFSB 1P0w== X-Gm-Message-State: AIkVDXJTvnSq8A/L3fIbRDg5l1O4oCbBNSR0panzBhjdEVSDRmHa71UjobzO6y5vcYqsBA== X-Received: by 10.237.35.140 with SMTP id j12mr51385513qtc.5.1483306421690; Sun, 01 Jan 2017 13:33:41 -0800 (PST) Received: from [192.168.0.26] (75-166-246-112.hlrn.qwest.net. [75.166.246.112]) by smtp.gmail.com with ESMTPSA id o44sm24692004qtc.8.2017.01.01.13.33.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jan 2017 13:33:41 -0800 (PST) Subject: Re: [PATCH] avoid non-printable characters in diagnostics (c/77620, c/77521) To: Gerald Pfeifer References: <57D21C36.3020906@gmail.com> <57D34305.3020908@gmail.com> Cc: Joseph Myers , gcc-patches@gcc.gnu.org From: Martin Sebor Message-ID: Date: Sun, 01 Jan 2017 21:33:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg00011.txt.bz2 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++ - :1:19: error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive] :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