From patchwork Thu Aug 9 17:18:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 28817 Received: (qmail 114370 invoked by alias); 9 Aug 2018 17:19:19 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 114234 invoked by uid 89); 9 Aug 2018 17:19:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.2 spammy= X-HELO: sesbmg23.ericsson.net Received: from sesbmg23.ericsson.net (HELO sesbmg23.ericsson.net) (193.180.251.37) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Aug 2018 17:19:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1533835151; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=rEQUtBJqbgzi0Xt0ooo1uxJr0BPlLQ1YlKHj9dkCtVQ=; b=aVc9mKxuBq5czZB0+SgfArV5xygOkqOnStSksj31z7a1Vht9qCqu8FvcZDHtYxY+ w9omPA5zlwgnr4mflJ8VbaaWS9qXxfiJGXWMD8sWJyEASigXQ9DVVKCpsAVEAXfT EE+zf9AQFwY2uYyWFF007RpNnr3SGvHiNw1uc6tsLqM=; Received: from ESESBMB504.ericsson.se (Unknown_Domain [153.88.183.117]) by sesbmg23.ericsson.net (Symantec Mail Security) with SMTP id 53.D9.27833.E877C6B5; Thu, 9 Aug 2018 19:19:11 +0200 (CEST) Received: from ESESBMB504.ericsson.se (153.88.183.171) by ESESBMB504.ericsson.se (153.88.183.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Thu, 9 Aug 2018 19:19:10 +0200 Received: from NAM05-DM3-obe.outbound.protection.outlook.com (153.88.183.157) by ESESBMB504.ericsson.se (153.88.183.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3 via Frontend Transport; Thu, 9 Aug 2018 19:19:10 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=guIRpJqd+3gmLKvMsgaPoMcU2g8taBV+/Xbq5dA6T/s=; b=ORFyGzfrBcNS/8in8n+vlhJ+UC1pGvq7t1TyFPkCv4OgEqO5BergqRUL/U71g0Wo9Cjx1e2ACHClmVObodJf1cj5icbEsh9hDZhDlsOLYZ+pnCelb31UvNabM9UCNR/OCsJlvMN0BJkM06vTosuY7t80+nnLYdqxPxsLaJEJHjg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; Received: from [142.133.60.222] (192.75.88.130) by BYAPR15MB2390.namprd15.prod.outlook.com (2603:10b6:a02:8c::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.20; Thu, 9 Aug 2018 17:19:06 +0000 Subject: Re: New ARI warning Wed Aug 8 01:55:57 UTC 2018 To: Simon Marchi , Pedro Alves CC: Joel Brobecker , GDB Administrator , References: <20180808015557.GA64451@sourceware.org> <20180809143249.GA2452@adacore.com> <2fecf1cd2db153dd8e09f244ab111407@polymtl.ca> From: Simon Marchi Message-ID: <766c3a11-d117-c014-4067-3c8eedd39057@ericsson.com> Date: Thu, 9 Aug 2018 13:18:50 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <2fecf1cd2db153dd8e09f244ab111407@polymtl.ca> Return-Path: simon.marchi@ericsson.com Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-IsSubscribed: yes On 2018-08-09 12:07 PM, Simon Marchi wrote: > On 2018-08-09 10:45, Pedro Alves wrote: >> On 08/09/2018 03:32 PM, Joel Brobecker wrote: >>>>> gdb/dwarf-index-write.c:1625:    perror_with_name ("rename"); >>>>>> gdb/dwarf-index-write.c:1640: gettext: _ markup: All messages should >>>>>> be marked up with _. >>>>> gdb/dwarf-index-write.c:1640:    perror_with_name ("rename"); >>>> >>>> I think these can be ignored, since these messages can't be translated. >>> >>> Let's add an ARI marker to document this, and silence the ARI? >>> Otherwise, someone looking at the ARI report for some easy things >>> to improve might come upon this one and waste time figuring out >>> that these cannot be translated. And also, it would prevent the >>> report from containing too many false positive... >> >> The way we've been quieting the ARI in these cases is this is the wrap >> in extra parens, without the "_": >> >>  $ grep perror * | grep "((" >>  event-loop.c:   perror_with_name (("poll")); >>  event-loop.c:       perror_with_name (("select")); >>  fbsd-nat.c:    perror_with_name (("ptrace")); >>  fbsd-nat.c:    perror_with_name (("ptrace")); >>  fbsd-nat.c:    perror_with_name (("ptrace")); >>  .... >> >> Thanks, >> Pedro Alves > > Ok, I'll do that, thanks. > > Simon Here's what I pushed: From 83c8d318d1aefecf3cc43015226c10bf4126df87 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 9 Aug 2018 13:17:21 -0400 Subject: [PATCH] Fix some gettext ARI warnings ARI produces this warning for the lines touched in this patch: warning: gettext: All messages should be marked up with _. However, in these cases, the message is not translatable (they are syscall names). Adding an extra set of parentheses silences the warning. gdb/ChangeLog: * common/scoped_mmap.c (mmap_file): Silence ARI warning. * dwarf-index-cache.c (create_dir_and_check): Likewise. (test_mkdir_recursive): Likewise. * dwarf-index-write.c (write_psymtabs_to_index): Likewise. --- gdb/ChangeLog | 7 +++++++ gdb/common/scoped_mmap.c | 6 +++--- gdb/dwarf-index-cache.c | 4 ++-- gdb/dwarf-index-write.c | 8 ++++---- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ebe1747..0a05299 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2018-08-09 Simon Marchi + + * common/scoped_mmap.c (mmap_file): Silence ARI warning. + * dwarf-index-cache.c (create_dir_and_check): Likewise. + (test_mkdir_recursive): Likewise. + * dwarf-index-write.c (write_psymtabs_to_index): Likewise. + 2018-08-09 Andrew Burgess * valarith.c (value_subscripted_rvalue): If an array is not in diff --git a/gdb/common/scoped_mmap.c b/gdb/common/scoped_mmap.c index aa2f703..7eb7293 100644 --- a/gdb/common/scoped_mmap.c +++ b/gdb/common/scoped_mmap.c @@ -28,11 +28,11 @@ mmap_file (const char *filename) { scoped_fd fd (open (filename, O_RDONLY)); if (fd.get () < 0) - perror_with_name ("open"); + perror_with_name (("open")); off_t size = lseek (fd.get (), 0, SEEK_END); if (size < 0) - perror_with_name ("lseek"); + perror_with_name (("lseek")); /* We can't map an empty file. */ if (size == 0) @@ -40,7 +40,7 @@ mmap_file (const char *filename) scoped_mmap mmapped_file (nullptr, size, PROT_READ, MAP_PRIVATE, fd.get (), 0); if (mmapped_file.get () == MAP_FAILED) - perror_with_name ("mmap"); + perror_with_name (("mmap")); return mmapped_file; } diff --git a/gdb/dwarf-index-cache.c b/gdb/dwarf-index-cache.c index 57118d6..966630b 100644 --- a/gdb/dwarf-index-cache.c +++ b/gdb/dwarf-index-cache.c @@ -359,7 +359,7 @@ create_dir_and_check (const char *dir) struct stat st; if (stat (dir, &st) != 0) - perror_with_name ("stat"); + perror_with_name (("stat")); return (st.st_mode & S_IFDIR) != 0; } @@ -372,7 +372,7 @@ test_mkdir_recursive () char base[] = "/tmp/gdb-selftests-XXXXXX"; if (mkdtemp (base) == NULL) - perror_with_name ("mkdtemp"); + perror_with_name (("mkdtemp")); /* Try not to leave leftover directories. */ struct cleanup_dirs { diff --git a/gdb/dwarf-index-write.c b/gdb/dwarf-index-write.c index 100619d..2520321 100644 --- a/gdb/dwarf-index-write.c +++ b/gdb/dwarf-index-write.c @@ -1577,7 +1577,7 @@ write_psymtabs_to_index (struct dwarf2_per_objfile *dwarf2_per_objfile, gdb::optional out_file_fd (gdb::in_place, mkstemp (filename_temp.data ())); if (out_file_fd->get () == -1) - perror_with_name ("mkstemp"); + perror_with_name (("mkstemp")); FILE *out_file = gdb_fopen_cloexec (filename_temp.data (), "wb").release (); if (out_file == nullptr) @@ -1601,7 +1601,7 @@ write_psymtabs_to_index (struct dwarf2_per_objfile *dwarf2_per_objfile, gdb::optional out_file_str_fd (gdb::in_place, mkstemp (filename_str_temp.data ())); if (out_file_str_fd->get () == -1) - perror_with_name ("mkstemp"); + perror_with_name (("mkstemp")); FILE *out_file_str = gdb_fopen_cloexec (filename_str_temp.data (), "wb").release (); @@ -1622,7 +1622,7 @@ write_psymtabs_to_index (struct dwarf2_per_objfile *dwarf2_per_objfile, /* Close and move the str file in place. */ close_out_file_str.reset (); if (rename (filename_str_temp.data (), filename_str.c_str ()) != 0) - perror_with_name ("rename"); + perror_with_name (("rename")); } else { @@ -1637,7 +1637,7 @@ write_psymtabs_to_index (struct dwarf2_per_objfile *dwarf2_per_objfile, /* Close and move the file in place. */ close_out_file.reset (); if (rename (filename_temp.data (), filename.c_str ()) != 0) - perror_with_name ("rename"); + perror_with_name (("rename")); } /* Implementation of the `save gdb-index' command.