diff options
| -rw-r--r-- | meta-oe/recipes-support/daemonize/daemonize/0001-fix-getopt.c-too-many-arguments-to-function-write-er.patch | 46 | ||||
| -rw-r--r-- | meta-oe/recipes-support/daemonize/daemonize_git.bb | 4 |
2 files changed, 49 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/daemonize/daemonize/0001-fix-getopt.c-too-many-arguments-to-function-write-er.patch b/meta-oe/recipes-support/daemonize/daemonize/0001-fix-getopt.c-too-many-arguments-to-function-write-er.patch new file mode 100644 index 0000000000..3a79dba682 --- /dev/null +++ b/meta-oe/recipes-support/daemonize/daemonize/0001-fix-getopt.c-too-many-arguments-to-function-write-er.patch | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | From c47fdcc0a900aea93b1967c20db42743171ab1ac Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "mark.yang" <mark.yang@lge.com> | ||
| 3 | Date: Thu, 27 Mar 2025 16:46:42 +0900 | ||
| 4 | Subject: [PATCH] fix getopt.c too many arguments to function 'write' error in | ||
| 5 | gcc-15.0.1 | ||
| 6 | |||
| 7 | In the original code, write() was declared as 'extern int write();', | ||
| 8 | which is interpreted as a function taking no parameters. | ||
| 9 | This caused errors when actually calling it with 3 parameters. | ||
| 10 | The current fix to declare it as 'extern int write(int, const void *, unsigned);' | ||
| 11 | is the correct solution. | ||
| 12 | This properly defines the write function to accept 3 parameters. | ||
| 13 | |||
| 14 | ../git/getopt.c: In function 'x_getopt': | ||
| 15 | ../git/getopt.c:51:16: error: too many arguments to function 'write'; expected 0, have 3 | ||
| 16 | 51 | (void) write(2, argv[0], (unsigned)strlen(argv[0]));\ | ||
| 17 | | ^~~~~ ~ | ||
| 18 | ../git/getopt.c:78:17: note: in expansion of macro 'ERR' | ||
| 19 | 78 | ERR(": illegal option -- ", c); | ||
| 20 | | ^~~ | ||
| 21 | ../git/getopt.c:48:20: note: declared here | ||
| 22 | 48 | extern int write();\ | ||
| 23 | | ^~~~~ | ||
| 24 | |||
| 25 | Upstream-Status: Submitted [https://github.com/bmc/daemonize/pull/37] | ||
| 26 | Signed-off-by: mark.yang <mark.yang@lge.com> | ||
| 27 | --- | ||
| 28 | getopt.c | 2 +- | ||
| 29 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 30 | |||
| 31 | diff --git a/getopt.c b/getopt.c | ||
| 32 | index 3f37c55..f298da7 100644 | ||
| 33 | --- a/getopt.c | ||
| 34 | +++ b/getopt.c | ||
| 35 | @@ -45,7 +45,7 @@ | ||
| 36 | #include <string.h> | ||
| 37 | |||
| 38 | #define ERR(s, c) if(x_opterr){\ | ||
| 39 | - extern int write();\ | ||
| 40 | + extern int write(int, const void *, unsigned);\ | ||
| 41 | char errbuf[2];\ | ||
| 42 | errbuf[0] = c; errbuf[1] = '\n';\ | ||
| 43 | (void) write(2, argv[0], (unsigned)strlen(argv[0]));\ | ||
| 44 | -- | ||
| 45 | 2.34.1 | ||
| 46 | |||
diff --git a/meta-oe/recipes-support/daemonize/daemonize_git.bb b/meta-oe/recipes-support/daemonize/daemonize_git.bb index f46dec59fc..b0712e521b 100644 --- a/meta-oe/recipes-support/daemonize/daemonize_git.bb +++ b/meta-oe/recipes-support/daemonize/daemonize_git.bb | |||
| @@ -7,7 +7,9 @@ PV = "1.7.8" | |||
| 7 | inherit autotools | 7 | inherit autotools |
| 8 | 8 | ||
| 9 | SRCREV = "18869a797dab12bf1c917ba3b4782fef484c407c" | 9 | SRCREV = "18869a797dab12bf1c917ba3b4782fef484c407c" |
| 10 | SRC_URI = "git://github.com/bmc/daemonize.git;branch=master;protocol=https \ | 10 | SRC_URI = " \ |
| 11 | git://github.com/bmc/daemonize.git;branch=master;protocol=https \ | ||
| 12 | file://0001-fix-getopt.c-too-many-arguments-to-function-write-er.patch \ | ||
| 11 | " | 13 | " |
| 12 | 14 | ||
| 13 | S = "${WORKDIR}/git" | 15 | S = "${WORKDIR}/git" |
