[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250207-small-marmot-of-opposition-e7afd3@leitao>
Date: Fri, 7 Feb 2025 10:45:39 -0800
From: Breno Leitao <leitao@...ian.org>
To: Mark Brown <broonie@...ian.org>
Cc: Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, Shuah Khan <shuah@...nel.org>,
linux-arm-kernel@...ts.infradead.org,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kselftest/arm64: Fix uninitialized variable warning in
FPMR test
Hello Mark,
On Fri, Feb 07, 2025 at 05:26:06PM +0000, Mark Brown wrote:
> On Fri, Feb 07, 2025 at 03:06:42AM -0800, Breno Leitao wrote:
> > Fix compiler warning about potentially uninitialized orig_fpmr variable:
> >
> > testcases/fpmr_siginfo.c: In function ‘fpmr_present’:
> > testcases/fpmr_siginfo.c:68:25: warning: ‘orig_fpmr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> > fprintf(stderr, "FPMR in frame is %llx, was %llx\n",
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > fpmr_ctx->fpmr, orig_fpmr);
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> This seems like something that should be reported to the compiler
> people, we only print the FPMR value if have_fpmr and there's an
> assignment to orig_fpmr in that case. Which compiler is this?
Good point. I am using:
# gcc --version
gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-2)
Clang, on the other hand, isn't upset about it.
# clang --target=aarch64-redhat-linux-gnu -fintegrated-as -Wall -O2 -g -I/home/leit/Devel/upstream/tools/testing/selftests/ -isystem /home/leit/Devel/upstream/usr/include -I/home/leit/Devel/upstream/tools/include -std=gnu99 -I. -Wno-address-of-packed-member -Wno-gnu-variable-sized-type-not-at-end -D_GNU_SOURCE= testcases/fpmr_siginfo.c test_signals.c test_signals_utils.c testcases/testcases.c signals.S sve_helpers.c -o testcases/fpmr_siginfo
# clang --version
clang version 19.1.3 (CentOS 19.1.3-1.el9)
Powered by blists - more mailing lists