]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Regtest: clean up warning and compilation of bug290061.c
authorPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 22 Apr 2025 05:22:42 +0000 (07:22 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 22 Apr 2025 05:22:42 +0000 (07:22 +0200)
On some platforms there was a 'defined but not used' warning.
When I fixed that I got a link error from clang. Using a
_LDFLAGS option causes automake to split building the test into
separate compile and link commands and clang was optimizing away
the unused static 'meh' symbol.

none/tests/Makefile.am
none/tests/bug290061.c

index 8f9018f46a7817288b44c4f6cc927e430d31b19a..043454828a993ed6ec3f21daeeff5110f30c36cb 100644 (file)
@@ -378,6 +378,7 @@ AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
 
 # Extra stuff for C tests
 ansi_CFLAGS            = $(AM_CFLAGS) -ansi
+bug290061_CFLAGS       = -fPIC
 bug290061_LDFLAGS      = @FLAG_PIE@
 bug491394_LDADD                = -lc
 bug491394_LDFLAGS      = -nostdlib -static
index 40d847e8e106c36fcaefc662c67f218f50968ae7..8a77037adfa7bea862cdc03b4c25b5ca70295a3e 100644 (file)
@@ -1,5 +1,6 @@
 static char meh[3000000]; // ~3mb
 int main(void)
 {
+    return meh[0];
 }