File: 0002-src-Fix-declaration-of-ldm_new.patch

package info (click to toggle)
libldm 0.2.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 780 kB
  • sloc: ansic: 3,832; xml: 654; makefile: 183; perl: 60; sh: 16
file content (63 lines) | stat: -rw-r--r-- 1,626 bytes parent folder | download
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 6 Feb 2025 13:43:01 +0000
Subject: src: Fix declaration of ldm_new
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

GCC 15 forbids declaring a function with () instead of (void).
Declaring it properly reveals an actual bug in ldmtool.

ldmtool.c: In function ‘main’:
ldmtool.c:859:23: error: too many arguments to function ‘ldm_new’; expected 0, have 1
  859 |     LDM * const ldm = ldm_new(&err);
      |                       ^~~~~~~ ~~~~
In file included from ldmtool.c:38:
ldm.h:259:6: note: declared here
  259 | LDM *ldm_new();
      |      ^~~~~~~
---
 src/ldm.c     | 2 +-
 src/ldm.h     | 2 +-
 src/ldmtool.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/ldm.c b/src/ldm.c
index 4766bb0..b7d319f 100644
--- a/src/ldm.c
+++ b/src/ldm.c
@@ -2351,7 +2351,7 @@ error:
 }
 
 LDM *
-ldm_new()
+ldm_new(void)
 {
     LDM *ldm = LDM_CAST(g_object_new(LDM_TYPE, NULL));
     ldm->priv->disk_groups = g_array_sized_new(FALSE, FALSE,
diff --git a/src/ldm.h b/src/ldm.h
index fd615b4..a35a817 100644
--- a/src/ldm.h
+++ b/src/ldm.h
@@ -254,7 +254,7 @@ GType ldm_disk_group_get_type(void);
  *
  * Returns: (transfer full): a new #LDM object
  */
-LDM *ldm_new();
+LDM *ldm_new(void);
 
 /**
  * ldm_add:
diff --git a/src/ldmtool.c b/src/ldmtool.c
index dbe2c8c..2e604e5 100644
--- a/src/ldmtool.c
+++ b/src/ldmtool.c
@@ -817,7 +817,7 @@ main(int argc, char *argv[])
     g_type_init();
 #endif
 
-    LDM * const ldm = ldm_new(&err);
+    LDM * const ldm = ldm_new();
 
     int ret = 0;