From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23591 invoked by alias); 27 Jun 2017 12:43:34 -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 22799 invoked by uid 89); 27 Jun 2017 12:43:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-yw0-f175.google.com Received: from mail-yw0-f175.google.com (HELO mail-yw0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Jun 2017 12:43:31 +0000 Received: by mail-yw0-f175.google.com with SMTP id j11so11322750ywa.2 for ; Tue, 27 Jun 2017 05:43:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WCrWoXghkX/RAppxltbMnLG7YwdaKz7fiAV3Fp/cdlo=; b=SjW8q3qNkkiQNV+DW9xzfw4i3d/MezcKpLsN1ORXbwKVvrh+bn4DVUVJd1qsnBTNra UDjdbxMZwu5UjJez2d3g9/w1xgVyQXEaVQPe72Q+yYmBhxhTEMeEyZjXq5ASb89H9A+z mhYgrvFVA5JpUcHvm0+iQpLd4wf72/U9zjCG0jCA46Q3RAFVtwI62hHZ+ghjm9PbeQoJ uux1HY0MgUxMo/9dl/747e4pFNI4QZQV0FwBgFtfh0WuH4YIU6vAv5W27HvLklPS5JMQ W7kPVlpI6SrCzFp7qiJq7c3ggAYZFDfJcj/rpdgXx9K4l92mQCuWRBHUZ3jL6dtGHpwV SuHw== X-Gm-Message-State: AKS2vOxdpoV0EKerUOn6yraRWFxFmW1p3echLodVTzHLveiIq3HaOqeI Rs3Xkn+UJUTQZg== X-Received: by 10.129.74.5 with SMTP id x5mr3660663ywa.49.1498567409724; Tue, 27 Jun 2017 05:43:29 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a3:20fb:7500:e7fb:4a6f:2254? ([2620:10d:c091:200::1:9018]) by smtp.googlemail.com with ESMTPSA id e63sm1110449ywd.35.2017.06.27.05.43.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Jun 2017 05:43:29 -0700 (PDT) Subject: Re: [PATCH 2/2] C++: bulletproof the %H and %I format codes (PR c++/81167) To: David Malcolm , gcc-patches@gcc.gnu.org References: <1498177241-34129-1-git-send-email-dmalcolm@redhat.com> <1498177241-34129-2-git-send-email-dmalcolm@redhat.com> From: Nathan Sidwell Message-ID: <22480c4e-393d-35fb-dd73-ebee44ceb0f9@acm.org> Date: Tue, 27 Jun 2017 12:43:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <1498177241-34129-2-git-send-email-dmalcolm@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017-06/txt/msg02017.txt.bz2 On 06/22/2017 08:20 PM, David Malcolm wrote: > PR c++/81167 reports a case where a NULL is passed to one of these %qH, > and it turns out that we now ICE for this case (with a gcc_assert) > whereas previously we printed a '' for the type > > This patch slightly reworks the %H and %I-handling code so that it > gracefully handles NULL, fixing the ICE in that PR. > Whilst I was at it, I also fixed things so that if only one of the > %H/%I codes is present, we do the right thing (i.e. fall back to > the %T behavior). I dislike this kind of silently accepting bogus use of an interface. I much prefer the compiler to explode. At least make it barf with a checking build, even if a production build permits the abuse. nathan -- Nathan Sidwell