From: Adhemerval Zanella Netto Date: Wed, 21 Sep 2022 13:51:06 +0000 (-0300) Subject: rt: Initialize mq_send input on tst-mqueue{5,6} X-Git-Tag: glibc-2.37~283 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cbf24edbb3123e3154ad2366912e0c1270ad3546;p=thirdparty%2Fglibc.git 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 --git a/rt/tst-mqueue5.c b/rt/tst-mqueue5.c index 70d97a36c2e..2b19b6a0311 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 bc875f101ef..a22ac05acae 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);