public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-7241] cygwin: Fix up -Werror=format-diag errors [PR104536]
@ 2022-02-15 11:19 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2022-02-15 11:19 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0863d0ede34d21b2258686e6ccfd6dbb100bb754

commit r12-7241-g0863d0ede34d21b2258686e6ccfd6dbb100bb754
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Feb 15 12:17:41 2022 +0100

    cygwin: Fix up -Werror=format-diag errors [PR104536]
    
    As the testcase reports, cygwin has 3 can%'t contractions in diagnostics,
    we use cannot everywhere else instead and -Wformat-diag enforces that.
    
    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.

Diff:
---
 gcc/config/i386/host-cygwin.cc | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/gcc/config/i386/host-cygwin.cc b/gcc/config/i386/host-cygwin.cc
index fcf6333193c..05ad3a8a41f 100644
--- a/gcc/config/i386/host-cygwin.cc
+++ b/gcc/config/i386/host-cygwin.cc
@@ -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, int fd)
   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;
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-15 11:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15 11:19 [gcc r12-7241] cygwin: Fix up -Werror=format-diag errors [PR104536] Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).