[PR #5134] [MERGED] fzenity: fix dead store #5373

Closed
opened 2026-05-05 10:37:17 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/5134
Author: @kmk3
Created: 5/7/2022
Status: Merged
Merged: 5/10/2022
Merged by: @kmk3

Base: masterHead: fix-fzenity-deadstore


📝 Commits (1)

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 src/fzenity/main.c (+1 -1)

📄 Description

As caught by the Clang Static Analyzer:

$ make clean && NO_EXTRA_CFLAGS="yes" scan-build --status-bugs make -C src/fzenity
[...]
main.c:77:10: warning: Value stored to 'ptr' is never read [deadcode.DeadStores]
                return ptr++;
                       ^~~~~
1 warning generated.
[...]
scan-build: Analysis run complete.
scan-build: 1 bug found.

The above increment is a no-op, as it is equivalent to
return ptr; ptr++;.

For it to make any difference, the prefix increment operator would have
to be used in place of the postfix one:

return ++ptr;

Which would be equivalent to ++ptr; return ptr;.

But in order to fix the warning (and CI) while avoiding to change the
current behavior, just remove the operator instead.

Added on commit 1cdfa6f95 ("more on firecfg --guide: fzenity",
2022-04-25).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netblue30/firejail/pull/5134 **Author:** [@kmk3](https://github.com/kmk3) **Created:** 5/7/2022 **Status:** ✅ Merged **Merged:** 5/10/2022 **Merged by:** [@kmk3](https://github.com/kmk3) **Base:** `master` ← **Head:** `fix-fzenity-deadstore` --- ### 📝 Commits (1) - [`bba57f4`](https://github.com/netblue30/firejail/commit/bba57f41778ba3da469031f3541a5ffaded3dc0c) fzenity: fix dead store ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/fzenity/main.c` (+1 -1) </details> ### 📄 Description As caught by the Clang Static Analyzer: $ make clean && NO_EXTRA_CFLAGS="yes" scan-build --status-bugs make -C src/fzenity [...] main.c:77:10: warning: Value stored to 'ptr' is never read [deadcode.DeadStores] return ptr++; ^~~~~ 1 warning generated. [...] scan-build: Analysis run complete. scan-build: 1 bug found. The above increment is a no-op, as it is equivalent to `return ptr; ptr++;`. For it to make any difference, the prefix increment operator would have to be used in place of the postfix one: return ++ptr; Which would be equivalent to `++ptr; return ptr;`. But in order to fix the warning (and CI) while avoiding to change the current behavior, just remove the operator instead. Added on commit 1cdfa6f95 ("more on firecfg --guide: fzenity", 2022-04-25). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 10:37:17 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#5373
No description provided.