public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin/main] Cygwin: accommodate gcc -Og option
Date: Wed, 14 Feb 2024 13:00:56 +0000 (GMT)	[thread overview]
Message-ID: <20240214130056.47528385DC3E@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=2a2a6486a089b90d05b258bd853d136f00cb7c69

commit 2a2a6486a089b90d05b258bd853d136f00cb7c69
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Wed Feb 14 14:00:34 2024 +0100
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Wed Feb 14 14:00:34 2024 +0100

    Cygwin: accommodate gcc -Og option
    
    All three warnings produced with -Og are false positives.
    But given we're using -Werror unconditionally it's better
    to be safe than sorry.
    
    Reported-by: Kevin Ushey <kevinushey@gmail.com>
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/fhandler/fifo.cc | 2 +-
 winsup/cygwin/tty.cc           | 2 +-
 winsup/utils/kill.cc           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/fhandler/fifo.cc b/winsup/cygwin/fhandler/fifo.cc
index efea508ae51c..ee49ce695e5a 100644
--- a/winsup/cygwin/fhandler/fifo.cc
+++ b/winsup/cygwin/fhandler/fifo.cc
@@ -669,7 +669,7 @@ fhandler_fifo::create_shmem (bool only_open)
 {
   HANDLE sect;
   OBJECT_ATTRIBUTES attr;
-  NTSTATUS status;
+  NTSTATUS status = STATUS_SUCCESS;
   LARGE_INTEGER size = { .QuadPart = sizeof (fifo_shmem_t) };
   SIZE_T viewsize = sizeof (fifo_shmem_t);
   PVOID addr = NULL;
diff --git a/winsup/cygwin/tty.cc b/winsup/cygwin/tty.cc
index bf7c6010fdc0..2cd4ae6ed43d 100644
--- a/winsup/cygwin/tty.cc
+++ b/winsup/cygwin/tty.cc
@@ -323,7 +323,7 @@ tty::wait_fwd ()
      thread when the last data is transfered. */
   const ULONGLONG sleep_in_nat_pipe = 16;
   const ULONGLONG time_to_wait = sleep_in_nat_pipe * 2 + 1/* margine */;
-  ULONGLONG elapsed;
+  ULONGLONG elapsed = 0;
   while (fwd_not_empty
 	 || (elapsed = GetTickCount64 () - fwd_last_time) < time_to_wait)
     {
diff --git a/winsup/utils/kill.cc b/winsup/utils/kill.cc
index fb45e4c9dcfa..bcabcd47c9ee 100644
--- a/winsup/utils/kill.cc
+++ b/winsup/utils/kill.cc
@@ -73,7 +73,7 @@ print_version ()
 static const char *
 strsigno (int signo)
 {
-  static char sigbuf[8];
+  static char sigbuf[32];
 
   if (signo > 0 && signo < SIGRTMIN)
     return sys_sigabbrev[signo];

                 reply	other threads:[~2024-02-14 13:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240214130056.47528385DC3E@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).