* New ARI warning Wed Aug 8 01:55:57 UTC 2018 @ 2018-08-08 1:56 GDB Administrator 2018-08-08 2:10 ` Simon Marchi 0 siblings, 1 reply; 6+ messages in thread From: GDB Administrator @ 2018-08-08 1:56 UTC (permalink / raw) To: gdb-patches 98a99,101 > gdb/common/scoped_mmap.c:31: gettext: _ markup: All messages should be marked up with _. gdb/common/scoped_mmap.c:31: perror_with_name ("open"); > gdb/common/scoped_mmap.c:35: gettext: _ markup: All messages should be marked up with _. gdb/common/scoped_mmap.c:35: perror_with_name ("lseek"); > gdb/common/scoped_mmap.c:43: gettext: _ markup: All messages should be marked up with _. gdb/common/scoped_mmap.c:43: perror_with_name ("mmap"); 152a156,161 > gdb/dwarf-index-cache.c:362: gettext: _ markup: All messages should be marked up with _. gdb/dwarf-index-cache.c:362: perror_with_name ("stat"); > gdb/dwarf-index-cache.c:375: gettext: _ markup: All messages should be marked up with _. gdb/dwarf-index-cache.c:375: perror_with_name ("mkdtemp"); > gdb/dwarf-index-write.c:1580: gettext: _ markup: All messages should be marked up with _. gdb/dwarf-index-write.c:1580: perror_with_name ("mkstemp"); > gdb/dwarf-index-write.c:1604: gettext: _ markup: All messages should be marked up with _. gdb/dwarf-index-write.c:1604: perror_with_name ("mkstemp"); > gdb/dwarf-index-write.c:1625: gettext: _ markup: All messages should be marked up with _. 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"); ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: New ARI warning Wed Aug 8 01:55:57 UTC 2018 2018-08-08 1:56 New ARI warning Wed Aug 8 01:55:57 UTC 2018 GDB Administrator @ 2018-08-08 2:10 ` Simon Marchi 2018-08-09 14:32 ` Joel Brobecker 0 siblings, 1 reply; 6+ messages in thread From: Simon Marchi @ 2018-08-08 2:10 UTC (permalink / raw) To: GDB Administrator; +Cc: gdb-patches On 2018-08-07 21:55, GDB Administrator wrote: > 98a99,101 >> gdb/common/scoped_mmap.c:31: gettext: _ markup: All messages should be >> marked up with _. > gdb/common/scoped_mmap.c:31: perror_with_name ("open"); >> gdb/common/scoped_mmap.c:35: gettext: _ markup: All messages should be >> marked up with _. > gdb/common/scoped_mmap.c:35: perror_with_name ("lseek"); >> gdb/common/scoped_mmap.c:43: gettext: _ markup: All messages should be >> marked up with _. > gdb/common/scoped_mmap.c:43: perror_with_name ("mmap"); > 152a156,161 >> gdb/dwarf-index-cache.c:362: gettext: _ markup: All messages should be >> marked up with _. > gdb/dwarf-index-cache.c:362: perror_with_name ("stat"); >> gdb/dwarf-index-cache.c:375: gettext: _ markup: All messages should be >> marked up with _. > gdb/dwarf-index-cache.c:375: perror_with_name ("mkdtemp"); >> gdb/dwarf-index-write.c:1580: gettext: _ markup: All messages should >> be marked up with _. > gdb/dwarf-index-write.c:1580: perror_with_name ("mkstemp"); >> gdb/dwarf-index-write.c:1604: gettext: _ markup: All messages should >> be marked up with _. > gdb/dwarf-index-write.c:1604: perror_with_name ("mkstemp"); >> gdb/dwarf-index-write.c:1625: gettext: _ markup: All messages should >> be marked up with _. > 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. Simon ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: New ARI warning Wed Aug 8 01:55:57 UTC 2018 2018-08-08 2:10 ` Simon Marchi @ 2018-08-09 14:32 ` Joel Brobecker 2018-08-09 14:46 ` Pedro Alves 0 siblings, 1 reply; 6+ messages in thread From: Joel Brobecker @ 2018-08-09 14:32 UTC (permalink / raw) To: Simon Marchi; +Cc: GDB Administrator, gdb-patches > > 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... -- Joel ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: New ARI warning Wed Aug 8 01:55:57 UTC 2018 2018-08-09 14:32 ` Joel Brobecker @ 2018-08-09 14:46 ` Pedro Alves 2018-08-09 16:07 ` Simon Marchi 0 siblings, 1 reply; 6+ messages in thread From: Pedro Alves @ 2018-08-09 14:46 UTC (permalink / raw) To: Joel Brobecker, Simon Marchi; +Cc: GDB Administrator, gdb-patches 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: New ARI warning Wed Aug 8 01:55:57 UTC 2018 2018-08-09 14:46 ` Pedro Alves @ 2018-08-09 16:07 ` Simon Marchi 2018-08-09 17:19 ` Simon Marchi 0 siblings, 1 reply; 6+ messages in thread From: Simon Marchi @ 2018-08-09 16:07 UTC (permalink / raw) To: Pedro Alves; +Cc: Joel Brobecker, GDB Administrator, gdb-patches 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: New ARI warning Wed Aug 8 01:55:57 UTC 2018 2018-08-09 16:07 ` Simon Marchi @ 2018-08-09 17:19 ` Simon Marchi 0 siblings, 0 replies; 6+ messages in thread From: Simon Marchi @ 2018-08-09 17:19 UTC (permalink / raw) To: Simon Marchi, Pedro Alves; +Cc: Joel Brobecker, GDB Administrator, gdb-patches 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 <simon.marchi@ericsson.com> 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 <simon.marchi@ericsson.com> + + * 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 <andrew.burgess@embecosm.com> * 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<scoped_fd> 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<scoped_fd> 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. -- 2.7.4 ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-08-09 17:19 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-08-08 1:56 New ARI warning Wed Aug 8 01:55:57 UTC 2018 GDB Administrator 2018-08-08 2:10 ` Simon Marchi 2018-08-09 14:32 ` Joel Brobecker 2018-08-09 14:46 ` Pedro Alves 2018-08-09 16:07 ` Simon Marchi 2018-08-09 17:19 ` Simon Marchi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox