Fix some gettext ARI warnings
authorSimon Marchi <simon.marchi@ericsson.com>
Thu, 9 Aug 2018 17:17:21 +0000 (13:17 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Thu, 9 Aug 2018 17:17:56 +0000 (13:17 -0400)
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
gdb/common/scoped_mmap.c
gdb/dwarf-index-cache.c
gdb/dwarf-index-write.c

index ebe1747..0a05299 100644 (file)
@@ -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
index aa2f703..7eb7293 100644 (file)
@@ -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;
 }
index 57118d6..966630b 100644 (file)
@@ -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 {
index 100619d..2520321 100644 (file)
@@ -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.