From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) by sourceware.org (Postfix) with ESMTPS id CACE4385829B for ; Wed, 21 Sep 2022 13:51:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CACE4385829B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-x22f.google.com with SMTP id d64so5104452oia.9 for ; Wed, 21 Sep 2022 06:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=NxZEpTFykwmNf3Ulz0NTZy9CR+0r/6/jwP4YIAgDdpI=; b=x/XN3+vVZA6G9bQdTrr3acOE9Znoozp74FY3oZJATYBfcDTf0g0N1qSzeCspq8HbV6 VJM0gHRbS5AAoezWtIX8hkizYJ+Y6HHuk1qpy6rcY/t5j5C0G0Gb8WdjPBVpXWHo82qK Xrfxdqnx/50MT8OibPGN8vt2FaTADi9Fzb9EaxnfWrb6DT25nqyTSenPNvFcqRdJj7mB xvKE8vHccKzD91xA1PfuYQYELmrLn4ShjxEXDc/g4g1HygUI9sAlNYLzhsO4OxZkPFzL 000D25sHQa9GVUKEA30JITaJ5BO/xcnzmi+aJTyplDE4trinTMbwSB8zq4Nz9mS+bgij STWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=NxZEpTFykwmNf3Ulz0NTZy9CR+0r/6/jwP4YIAgDdpI=; b=f+TnoNkp/B6sJ4rT31MKfmyW27NGXRmOpO2gamsbEuqQTgFfVMwPsA2Qp9YXipJJ7A NsNeR1KdELgip4U/62wmZoKU/7kjghIfNJOEEGHCitE+AC1Qabe3N8tjoFYjuO1XayH6 BkUozEdR8d/CCH1gY1f2zedRmNpUAmv4DAShWnigQ0ShD/sv73/5Vf0uuZYgVYZfSMP+ 79A2WrotjAVtgaINDggwCZi2zkcy0gntfI6Pitzbmj2GQ2Dce6bRXQWL8q55zvAy+fyr r2hUNNc5Y2V2YWlit8tZcBaw9HtjjbMAgbTxhc7vghX83IuQqhgb2TbBj5cSXpttueiQ klRQ== X-Gm-Message-State: ACrzQf24sWVW+zD0KgERhq2ioWYbOhzG9A7IKxcA7vK3PNcLdpZlKD97 miBqvb7Sn+7sSDO6xGurAS377qkquIJlQflS X-Google-Smtp-Source: AMsMyM5gtTgappgpI8mhFzTKNuTaoeB4KedbnvRR5KCuS8Z797zuFxgZZdoHs7XF7XAVC2dD5mw6gA== X-Received: by 2002:a05:6808:3010:b0:343:f19:d58b with SMTP id ay16-20020a056808301000b003430f19d58bmr4002400oib.282.1663768283900; Wed, 21 Sep 2022 06:51:23 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c1:c266:dbbf:9e84:6582:5289]) by smtp.gmail.com with ESMTPSA id a38-20020a05687046a600b0010bf07976c9sm1669476oap.41.2022.09.21.06.51.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 06:51:23 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 4/6] rt: Initialize mq_send input on tst-mqueue{5,6} Date: Wed, 21 Sep 2022 10:51:06 -0300 Message-Id: <20220921135108.3324737-5-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220921135108.3324737-1-adhemerval.zanella@linaro.org> References: <20220921135108.3324737-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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. --- 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); -- 2.34.1