unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 5489c87bfd5adc83c708ab951820d6b76af43489 1462 bytes (raw)
name: gnu/packages/patches/libaio-fix-build.patch 	 # note: path name is non-authoritative(*)

 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
 
From b9e17f6afdc4d0e81b1598aecea7b80d0c54b13a Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@hadrons.org>
Date: Jul 29 2019 16:26:10 +0000
Subject: harness: Use destination strncpy() expression for sizeof() argument


Even though this is the same size, as the sizeof() is derived from the
source expression, recent gcc versions will emit a warning, which is
turned into an error by -Werror:

  error: argument to ‘sizeof’ in ‘strncpy’ call is the same expression
    as the source; did you mean to use the size of the destination?
    [-Werror=sizeof-pointer-memaccess]

Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>

---

diff --git a/harness/cases/19.t b/harness/cases/19.t
index 4989510..5c3e0d6 100644
--- a/harness/cases/19.t
+++ b/harness/cases/19.t
@@ -41,7 +41,7 @@ open_temp_file(void)
 	int fd;
 	char template[sizeof(TEMPLATE)];

-	strncpy(template, TEMPLATE, sizeof(TEMPLATE));
+	strncpy(template, TEMPLATE, sizeof(template));
 	fd = mkostemp(template, O_DIRECT);
 	if (fd < 0) {
 		perror("mkstemp");
diff --git a/harness/cases/21.t b/harness/cases/21.t
index 441eaa8..fe33a9d 100644
--- a/harness/cases/21.t
+++ b/harness/cases/21.t
@@ -43,7 +43,7 @@ open_temp_file()
 	int fd;
 	char temp_file[sizeof(TEMPLATE)];

-	strncpy(temp_file, TEMPLATE, sizeof(TEMPLATE));
+	strncpy(temp_file, TEMPLATE, sizeof(temp_file));
 	fd = mkstemp(temp_file);
 	if (fd < 0) {
 		perror("mkstemp");


debug log:

solving 68b69a5fb2 ...
found 68b69a5fb2 in https://yhetil.org/guix-patches/20210602100107.28577-1-jonathan.brielmaier@web.de/

applying [1/1] https://yhetil.org/guix-patches/20210602100107.28577-1-jonathan.brielmaier@web.de/
diff --git a/gnu/packages/patches/libaio-fix-build.patch b/gnu/packages/patches/libaio-fix-build.patch
new file mode 100644
index 0000000000..68b69a5fb2

1:31: space before tab in indent.
 	int fd;
1:32: space before tab in indent.
 	char template[sizeof(TEMPLATE)];
1:36: space before tab in indent.
 	fd = mkostemp(template, O_DIRECT);
1:37: space before tab in indent.
 	if (fd < 0) {
1:38: space before tab in indent.
 		perror("mkstemp");
Checking patch gnu/packages/patches/libaio-fix-build.patch...
Applied patch gnu/packages/patches/libaio-fix-build.patch cleanly.
warning: squelched 6 whitespace errors
warning: 11 lines add whitespace errors.

index at:
100644 5489c87bfd5adc83c708ab951820d6b76af43489	gnu/packages/patches/libaio-fix-build.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).