Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 906234 - sys-apps/sandbox-2.30-r1: src/environ.c:211:19: warning: the comparison will always evaluate as ‘true’ for the address of ‘work_dir’ will never be NULL
Summary: sys-apps/sandbox-2.30-r1: src/environ.c:211:19: warning: the comparison will ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sandbox Maintainers
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2023-05-13 01:43 UTC by nvinson234
Modified: 2023-08-06 00:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
remove_always_true_if.patch (XkjfsU,614 bytes, patch)
2023-05-13 01:45 UTC, nvinson234
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description nvinson234 2023-05-13 01:43:09 UTC
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
Comment 1 nvinson234 2023-05-13 01:45:10 UTC
Created attachment 861600 [details, diff]
remove_always_true_if.patch
Comment 2 Larry the Git Cow gentoo-dev 2023-08-05 23:38:56 UTC
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(-)
Comment 3 Larry the Git Cow gentoo-dev 2023-08-06 00:51:58 UTC
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(+)