diff options
author | mark.yang <mark.yang@lge.com> | 2025-03-26 16:34:09 +0900 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2025-03-26 07:37:50 -0700 |
commit | 1de4965018c57bba9b3040b6704c65ecc0cbd77c (patch) | |
tree | 638d3f81a1dcb740ead68c2d4b887e938522f125 | |
parent | 950b33eebf56a2504f17f1d0c2dffd66f3f96652 (diff) | |
download | meta-openembedded-1de4965018c57bba9b3040b6704c65ecc0cbd77c.tar.gz |
cpulimit: fix build with gcc-15
* to fix: Error occurs in gcc 15.0.1 environment.
busy.c: In function 'main':
busy.c:20:58: error: passing argument 3 of 'pthread_create' from incompatible pointer type [-Wincompatible-pointer-types]
20 | if ((ret = pthread_create(&thread, NULL, loop, NULL)) != 0)
| ^~~~
| |
| void * (*)(void)
In file included from busy.c:3:
recipe-sysroot/usr/include/pthread.h:204:36: note: expected 'void * (*)(void *)' but argument is of type 'void * (*)(void)'
204 | void *(*__start_routine) (void *),
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
busy.c:6:7: note: 'loop' declared here
6 | void *loop()
| ^~~~
Signed-off-by: mark.yang <mark.yang@lge.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-oe/recipes-support/cpulimit/cpulimit/0002-busy.c-Fix-incompatible-pointer-type-error.patch | 51 | ||||
-rw-r--r-- | meta-oe/recipes-support/cpulimit/cpulimit_0.2.bb | 1 |
2 files changed, 52 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/cpulimit/cpulimit/0002-busy.c-Fix-incompatible-pointer-type-error.patch b/meta-oe/recipes-support/cpulimit/cpulimit/0002-busy.c-Fix-incompatible-pointer-type-error.patch new file mode 100644 index 0000000000..c75cbe1950 --- /dev/null +++ b/meta-oe/recipes-support/cpulimit/cpulimit/0002-busy.c-Fix-incompatible-pointer-type-error.patch | |||
@@ -0,0 +1,51 @@ | |||
1 | From 86b71c49a373f78920d78c0e88f530f476b4fe70 Mon Sep 17 00:00:00 2001 | ||
2 | From: "mark.yang" <mark.yang@lge.com> | ||
3 | Date: Wed, 26 Mar 2025 15:57:54 +0900 | ||
4 | Subject: [PATCH] busy.c: Fix incompatible pointer type error. | ||
5 | |||
6 | Error occurs in gcc 15.0.1 environment. | ||
7 | busy.c: In function 'main': | ||
8 | busy.c:20:58: error: passing argument 3 of 'pthread_create' from incompatible pointer type [-Wincompatible-pointer-types] | ||
9 | 20 | if ((ret = pthread_create(&thread, NULL, loop, NULL)) != 0) | ||
10 | | ^~~~ | ||
11 | | | | ||
12 | | void * (*)(void) | ||
13 | In file included from busy.c:3: | ||
14 | recipe-sysroot/usr/include/pthread.h:204:36: note: expected 'void * (*)(void *)' but argument is of type 'void * (*)(void)' | ||
15 | 204 | void *(*__start_routine) (void *), | ||
16 | | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ | ||
17 | busy.c:6:7: note: 'loop' declared here | ||
18 | 6 | void *loop() | ||
19 | | ^~~~ | ||
20 | |||
21 | Set loop parameter to void* since it requires void* type argument. | ||
22 | |||
23 | Signed-off-by: mark.yang <mark.yang@lge.com> | ||
24 | |||
25 | Upstream-Status: Inactive-Upstream [lastcommit: 9 Years ago and lastrelease: 9 Years ago] | ||
26 | --- | ||
27 | tests/busy.c | 4 ++-- | ||
28 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
29 | |||
30 | diff --git a/tests/busy.c b/tests/busy.c | ||
31 | index b3afb7c..2d726eb 100644 | ||
32 | --- a/tests/busy.c | ||
33 | +++ b/tests/busy.c | ||
34 | @@ -3,7 +3,7 @@ | ||
35 | #include <pthread.h> | ||
36 | #include <unistd.h> | ||
37 | |||
38 | -void *loop() | ||
39 | +void *loop(void *arg) | ||
40 | { | ||
41 | while(1); | ||
42 | } | ||
43 | @@ -23,7 +23,7 @@ int main(int argc, char **argv) { | ||
44 | exit(1); | ||
45 | } | ||
46 | } | ||
47 | - loop(); | ||
48 | + loop(NULL); | ||
49 | return 0; | ||
50 | } | ||
51 | \ No newline at end of file | ||
diff --git a/meta-oe/recipes-support/cpulimit/cpulimit_0.2.bb b/meta-oe/recipes-support/cpulimit/cpulimit_0.2.bb index f88d3b6ca1..ee2f91343e 100644 --- a/meta-oe/recipes-support/cpulimit/cpulimit_0.2.bb +++ b/meta-oe/recipes-support/cpulimit/cpulimit_0.2.bb | |||
@@ -7,6 +7,7 @@ SRCREV ?= "f4d2682804931e7aea02a869137344bb5452a3cd" | |||
7 | 7 | ||
8 | SRC_URI = "git://github.com/opsengine/cpulimit.git;protocol=https;branch=master \ | 8 | SRC_URI = "git://github.com/opsengine/cpulimit.git;protocol=https;branch=master \ |
9 | file://0001-Remove-sys-sysctl.h-and-add-missing-libgen.h-include.patch \ | 9 | file://0001-Remove-sys-sysctl.h-and-add-missing-libgen.h-include.patch \ |
10 | file://0002-busy.c-Fix-incompatible-pointer-type-error.patch \ | ||
10 | " | 11 | " |
11 | 12 | ||
12 | S = "${WORKDIR}/git" | 13 | S = "${WORKDIR}/git" |