summaryrefslogtreecommitdiff
path: root/dev-libs/libffi/files/libffi-3.4.6-c23-tests.patch
blob: dc53b120cd908b9fe7d2f48f5cc785e759970567 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
https://github.com/libffi/libffi/commit/0859f8431242d5adff21420b9cab538d2af527b5

From 0859f8431242d5adff21420b9cab538d2af527b5 Mon Sep 17 00:00:00 2001
From: Joseph Myers <jsm@polyomino.org.uk>
Date: Thu, 24 Oct 2024 18:26:58 +0000
Subject: [PATCH] Fix testsuite for C23 `va_start` (#861)

In the C23 revision of the C standard, `va_start` ignores its second
argument, which is no longer required (previously the last named
function parameter - which the compiler knows anyway, so it's
redundant information).

This has the consequence for the libffi testsuite, when making GCC
default to `-std=gnu23`, of making two tests fail with warnings about
an unused function argument (only passed to `va_start` and not
otherwise used).  Fix those test failures by explicitly casting the
argument to `void`.
--- a/testsuite/libffi.call/va_struct2.c
+++ b/testsuite/libffi.call/va_struct2.c
@@ -33,6 +33,7 @@ test_fn (int n, ...)
   struct small_tag s2;
   struct large_tag l;
 
+  (void) n;
   va_start (ap, n);
   s1 = va_arg (ap, struct small_tag);
   l = va_arg (ap, struct large_tag);
--- a/testsuite/libffi.call/va_struct3.c
+++ b/testsuite/libffi.call/va_struct3.c
@@ -33,6 +33,7 @@ test_fn (int n, ...)
   struct small_tag s2;
   struct large_tag l;
 
+  (void) n;
   va_start (ap, n);
   s1 = va_arg (ap, struct small_tag);
   l = va_arg (ap, struct large_tag);