[PR #4376] [MERGED] gcov: use no-op functions if not enabled #5139

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

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/4376
Author: @kmk3
Created: 6/27/2021
Status: Merged
Merged: 6/28/2021
Merged by: @netblue30

Base: masterHead: gcov-add-nop-functions


📝 Commits (2)

  • 98d223d gcov: fix indentation
  • 5106b2e gcov: use no-op functions if not enabled

📊 Changes

15 files changed (+64 additions, -110 deletions)

View changed files

📝 src/firejail/appimage.c (+2 -6)
📝 src/firejail/chroot.c (+2 -6)
📝 src/firejail/fs.c (+2 -6)
📝 src/firejail/fs_mkdir.c (+3 -6)
📝 src/firejail/ls.c (+6 -10)
📝 src/firejail/main.c (+3 -6)
📝 src/firejail/profile.c (+2 -6)
📝 src/firejail/rlimit.c (+14 -16)
📝 src/firejail/sandbox.c (+3 -8)
📝 src/firejail/util.c (+11 -14)
📝 src/firemon/interface.c (+3 -6)
📝 src/firemon/netstats.c (+3 -7)
📝 src/firemon/procevent.c (+1 -6)
📝 src/firemon/top.c (+3 -7)
📝 src/include/gcov_wrapper.h (+6 -0)

📄 Description

Instead of wrapping every gcov function call in an ifdef.

Note: The usage of ((void)0) is based on section 7.2 of the C99
standard (N1256)[1] [2]:

7.2 Diagnostics <assert.h>

1 The header <assert.h> defines the assert macro and refers to another
macro,

NDEBUG

which is not defined by <assert.h>. If NDEBUG is defined as a macro
name at the point in the source file where <assert.h> is included, the
assert macro is defined simply as

#define assert(ignore) ((void)0)

See also assert.h(0p) from POSIX.1-2017[3].

Note: This is a continuation of commit b408b20c7 ("gcov: fix build
failure with gcc 11.1.0") / PR #4373.

[1] http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf
[2] https://port70.net/~nsz/c/c99/n1256.html#7.2
[3] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/assert.h.html


🔄 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/4376 **Author:** [@kmk3](https://github.com/kmk3) **Created:** 6/27/2021 **Status:** ✅ Merged **Merged:** 6/28/2021 **Merged by:** [@netblue30](https://github.com/netblue30) **Base:** `master` ← **Head:** `gcov-add-nop-functions` --- ### 📝 Commits (2) - [`98d223d`](https://github.com/netblue30/firejail/commit/98d223da37787b5c6844a9e4b2850af81f1bb4a9) gcov: fix indentation - [`5106b2e`](https://github.com/netblue30/firejail/commit/5106b2ec404d4085cb4f741aeca9f2bdc95878a9) gcov: use no-op functions if not enabled ### 📊 Changes **15 files changed** (+64 additions, -110 deletions) <details> <summary>View changed files</summary> 📝 `src/firejail/appimage.c` (+2 -6) 📝 `src/firejail/chroot.c` (+2 -6) 📝 `src/firejail/fs.c` (+2 -6) 📝 `src/firejail/fs_mkdir.c` (+3 -6) 📝 `src/firejail/ls.c` (+6 -10) 📝 `src/firejail/main.c` (+3 -6) 📝 `src/firejail/profile.c` (+2 -6) 📝 `src/firejail/rlimit.c` (+14 -16) 📝 `src/firejail/sandbox.c` (+3 -8) 📝 `src/firejail/util.c` (+11 -14) 📝 `src/firemon/interface.c` (+3 -6) 📝 `src/firemon/netstats.c` (+3 -7) 📝 `src/firemon/procevent.c` (+1 -6) 📝 `src/firemon/top.c` (+3 -7) 📝 `src/include/gcov_wrapper.h` (+6 -0) </details> ### 📄 Description Instead of wrapping every gcov function call in an ifdef. Note: The usage of `((void)0)` is based on section 7.2 of the C99 standard (N1256)[1] [2]: > 7.2 Diagnostics <assert.h> > > 1 The header <assert.h> defines the assert macro and refers to another > macro, > > NDEBUG > > which is not defined by <assert.h>. If NDEBUG is defined as a macro > name at the point in the source file where <assert.h> is included, the > assert macro is defined simply as > > #define assert(ignore) ((void)0) See also assert.h(0p) from POSIX.1-2017[3]. Note: This is a continuation of commit b408b20c7 ("gcov: fix build failure with gcc 11.1.0") / PR #4373. [1] http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf [2] https://port70.net/~nsz/c/c99/n1256.html#7.2 [3] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/assert.h.html --- <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:33:00 -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#5139
No description provided.