Found using gcc -fanalzyer. The comparison at src/environ.c:211:19 will always evaluate as ‘true’ for the address of ‘work_dir’ will never be NULL Reproducible: Always Steps to Reproduce: 1. build with gcc -fanalzyer using gcc-13 Actual Results: compiler issues warning Expected Results: compiler does not issue warning
Created attachment 861600 [details, diff] remove_always_true_if.patch
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=7f230519475c2aaea91df75b0165d8b6c03b9fa9 commit 7f230519475c2aaea91df75b0165d8b6c03b9fa9 Author: gto2023 <gto7052@mailbox.org> AuthorDate: 2023-07-13 11:59:24 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2023-08-05 20:07:55 +0000 sandbox: do not compare array to NULL Fixes a compiler warning: ``` src/environ.c:211:19: warning: the comparison will always evaluate as ‘true’ for the address of ‘work_dir’ will never be NULL [-Waddress] ``` Bug: https://bugs.gentoo.org/906234 Signed-off-by: gto2023 <gto7052@mailbox.org> Signed-off-by: Mike Gilbert <floppym@gentoo.org> src/environ.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=761c8d19f1549cd137d2b0a0cbcb12f569dfba5e commit 761c8d19f1549cd137d2b0a0cbcb12f569dfba5e Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2023-08-06 00:50:57 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2023-08-06 00:51:49 +0000 sys-apps/sandbox: add 2.38 Closes: https://bugs.gentoo.org/906234 Closes: https://bugs.gentoo.org/910273 Closes: https://bugs.gentoo.org/910561 Signed-off-by: Mike Gilbert <floppym@gentoo.org> sys-apps/sandbox/Manifest | 1 + sys-apps/sandbox/sandbox-2.38.ebuild | 64 ++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=b0b2afb1941f540126aa510d47636cd8d2cf9ad8 commit b0b2afb1941f540126aa510d47636cd8d2cf9ad8 Author: gto2023 <gto7052@mailbox.org> AuthorDate: 2023-07-13 11:59:24 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2023-08-06 00:39:52 +0000 sandbox: do not compare array to NULL Fixes a compiler warning: ``` src/environ.c:211:19: warning: the comparison will always evaluate as ‘true’ for the address of ‘work_dir’ will never be NULL [-Waddress] ``` Bug: https://bugs.gentoo.org/906234 Signed-off-by: gto2023 <gto7052@mailbox.org> Signed-off-by: Mike Gilbert <floppym@gentoo.org> (cherry picked from commit 7f230519475c2aaea91df75b0165d8b6c03b9fa9) src/environ.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)