diff mbox series

[committed] cygwin: Fix up -Werror=format-diag errors [PR104536]

Message ID 20220215112012.GP2646553@tucnak
State New
Headers show
Series [committed] cygwin: Fix up -Werror=format-diag errors [PR104536] | expand

Commit Message

Jakub Jelinek Feb. 15, 2022, 11:20 a.m. UTC
Hi!

As the testcase reports, cygwin has 3 can%'t contractions in diagnostics,
we use cannot everywhere else instead and -Wformat-diag enforces that.

Fixed thusly, untested, committed as obvious to unbreak cygwin bootstraps.

2022-02-15  Jakub Jelinek  <jakub@redhat.com>

	PR target/104536
	* config/i386/host-cygwin.cc (cygwin_gt_pch_get_address): Use
	cannot instead of can%'t in diagnostics.  Formatting fixes.


	Jakub
diff mbox series

Patch

--- gcc/config/i386/host-cygwin.cc.jj	2022-01-18 11:58:59.111988785 +0100
+++ gcc/config/i386/host-cygwin.cc	2022-02-15 12:16:10.123180015 +0100
@@ -51,18 +51,18 @@  static void *
 cygwin_gt_pch_get_address (size_t sz, int fd)
 {
   void *base;
-  off_t p = lseek(fd, 0, SEEK_CUR);
+  off_t p = lseek (fd, 0, SEEK_CUR);
 
   if (p == (off_t) -1)
-    fatal_error (input_location, "can%'t get position in PCH file: %m");
+    fatal_error (input_location, "cannot get position in PCH file: %m");
 
    /* Cygwin requires that the underlying file be at least
       as large as the requested mapping.  */
   if ((size_t) p < sz)
-  { 
-    if ( ftruncate (fd, sz) == -1 )
-      fatal_error (input_location, "can%'t extend PCH file: %m");
-  }
+    { 
+      if (ftruncate (fd, sz) == -1)
+	fatal_error (input_location, "cannot extend PCH file: %m");
+    }
 
   base = mmap (NULL, sz, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
 
@@ -71,8 +71,8 @@  cygwin_gt_pch_get_address (size_t sz, in
   else
     munmap (base, sz);
 
-  if (lseek (fd, p, SEEK_SET) == (off_t) -1 )
-    fatal_error (input_location, "can%'t set position in PCH file: %m");
+  if (lseek (fd, p, SEEK_SET) == (off_t) -1)
+    fatal_error (input_location, "cannot set position in PCH file: %m");
 
   return base;
 }