From patchwork Mon Jul 25 19:46:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 652392 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ryrf60ntlz9t1H for ; Tue, 26 Jul 2016 05:19:09 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=nh+U0P9G; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=LcyRPPfiqsSh +euk3+Tznr2Oi7qreNtNBbkaZiKItiK9NyiYLP4VsAUL1v9v8u3YGS2Qq0yVIO9p V8yb0C3wtPOvBlSOM0BMKfnYRLtk1sEo0bSQLf/EkHmOWoz8N6b9l1r/3B2MuekZ DUz69Kuatu1bgjyHmP/a61thlqkMFLk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; s=default; bh=gUlwc+nZjh8tYrqDSp umqtQ9+gg=; b=nh+U0P9GJpdtlqW4/cViCb4G9clDQkIQ/kx7QolbCG+H4ga/w5 CzNts8XZZwpvNsol1FA/wi1/6JCD45b3asFVuHq4ZvaqXOceTEvxPNbN21Yw/seD zoMxpEHPdYpRY/qSxRahCCif45kRunqBTcOOlHKWbPyFLk8pso+2wglOU= Received: (qmail 57558 invoked by alias); 25 Jul 2016 19:19:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 57548 invoked by uid 89); 25 Jul 2016 19:19:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=buggy X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 25 Jul 2016 19:18:57 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 340D620266 for ; Mon, 25 Jul 2016 19:18:55 +0000 (UTC) Received: from c64.redhat.com (vpn-226-234.phx2.redhat.com [10.3.226.234]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6PJIs2F024891; Mon, 25 Jul 2016 15:18:54 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [committed] Fix selftest::temp_source_file ctor Date: Mon, 25 Jul 2016 15:46:54 -0400 Message-Id: <1469476014-43612-1-git-send-email-dmalcolm@redhat.com> X-IsSubscribed: yes Temporary source files created by the selftests weren't generated correctly if they contained a "%" character (seen whilst writing selftests for the locations-within-string-literals patch I'm working on). Root cause was a buggy fprintf in the selftest::temp_source_file ctor. Fixed thusly. Successfully bootstrapped®rtested on x86_64-pc-linux-gnu; committed to trunk (as r238732), under the "obvious" rule. gcc/ChangeLog: * input.c (selftest::temp_source_file::temp_source_file): Fix missing "%s" in fprintf. --- gcc/input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/input.c b/gcc/input.c index a916597..47845d00 100644 --- a/gcc/input.c +++ b/gcc/input.c @@ -1175,7 +1175,7 @@ temp_source_file::temp_source_file (const location &loc, const char *suffix, if (!out) ::selftest::fail_formatted (loc, "unable to open tempfile: %s", m_filename); - fprintf (out, content); + fprintf (out, "%s", content); fclose (out); }