From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id D9FDF3857416; Wed, 5 Oct 2022 21:43:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9FDF3857416 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665006224; bh=KxtOpzfWwgIlJxU2WLp2+ToyDUoavDTyF4cw5FjhKVM=; h=From:To:Subject:Date:From; b=VA48GnGxQJACqifR2NjY1zTrKZmOSUDZG2smblb7zTMZCDdBfGk2/jQprIP5jxUsN AR0fykQnjrfSOm9X02gzT3Pyz8Le6GrPowE56UXko5ruDuPDDGN71xO7Ce0lWw39Kg K/xq4CviPEiXGqYTzk3P3gUnBoiU8u3yLTi5Tb2E= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] rt: Initialize mq_send input on tst-mqueue{5,6} X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella Netto X-Git-Refname: refs/heads/master X-Git-Oldrev: 442e3a21724b07b3ae1c3c5eeba4a8e44a1a50a3 X-Git-Newrev: cbf24edbb3123e3154ad2366912e0c1270ad3546 Message-Id: <20221005214344.D9FDF3857416@sourceware.org> Date: Wed, 5 Oct 2022 21:43:44 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cbf24edbb3123e3154ad2366912e0c1270ad3546 commit cbf24edbb3123e3154ad2366912e0c1270ad3546 Author: Adhemerval Zanella Netto Date: Wed Sep 21 10:51:06 2022 -0300 rt: Initialize mq_send input on tst-mqueue{5,6} GCC with -Os warns that the mq_send input may be used uninitialized. Although for the tests the data content sent is not important, since both tests checks only if mq_notify was properly set, the warning is correct and data is indeed uninitialized. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell Diff: --- rt/tst-mqueue5.c | 2 +- rt/tst-mqueue6.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rt/tst-mqueue5.c b/rt/tst-mqueue5.c index 70d97a36c2..2b19b6a031 100644 --- a/rt/tst-mqueue5.c +++ b/rt/tst-mqueue5.c @@ -58,7 +58,7 @@ rtmin_handler (int sig, siginfo_t *info, void *ctx) static int (mqsend) (mqd_t q, int line) { - char c; + char c = 0; if (mq_send (q, &c, 1, 1) != 0) { printf ("mq_send on line %d failed with: %m\n", line); diff --git a/rt/tst-mqueue6.c b/rt/tst-mqueue6.c index bc875f101e..a22ac05aca 100644 --- a/rt/tst-mqueue6.c +++ b/rt/tst-mqueue6.c @@ -40,7 +40,7 @@ static int (mqsend) (mqd_t q, int line) { - char c; + char c = 0; if (mq_send (q, &c, 1, 1) != 0) { printf ("mq_send on line %d failed with: %m\n", line);