-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #432 from nqminds/tests/fix-test-edgesec-codecov
Use `__maybe_unused` compiler attribute to fix flakey code-coverage in `test_edgesec`
- Loading branch information
Showing
13 changed files
with
72 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
|
||
#include "common.h" | ||
|
||
#include "../utils/attributes.h" | ||
#include "utils/os.h" | ||
|
||
/* RFC 2865 - RADIUS */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* @file | ||
* @author Alois Klink <alois@nquiringminds.com> | ||
* @date 2023 | ||
* @copyright | ||
* SPDX-FileCopyrightText: © 2023 NQMCyber Ltd and edgesec contributors | ||
* SPDX-License-Identifier: Expat | ||
* @brief File containing macros for compiler attributes, if they are supported. | ||
* | ||
* In the future, once we support C23, we can remove this header and just | ||
* use C23 attributes. | ||
*/ | ||
#ifndef ATTRIBUTES_H | ||
#define ATTRIBUTES_H | ||
|
||
#ifndef __maybe_unused | ||
#if defined __has_attribute | ||
#if __has_attribute(unused) | ||
/** | ||
* If used before a variable, tells the compiler that variable can be unused. | ||
* (e.g. does the same thing as casting to `(void)`, or `[[maybe_unused]]` in | ||
* C23). | ||
* | ||
* @see https://clang.llvm.org/docs/AttributeReference.html#maybe-unused-unused | ||
*/ | ||
#define __maybe_unused __attribute__((unused)) | ||
#else | ||
#define __maybe_unused | ||
#endif /* __has_attribute(unused) */ | ||
#else | ||
#define __maybe_unused | ||
#endif /* defined __has_attribute */ | ||
#endif /* __maybe_unused */ | ||
|
||
#ifdef __GNUC__ | ||
#define STRUCT_PACKED __attribute__((packed)) | ||
#else | ||
#define STRUCT_PACKED | ||
#endif | ||
|
||
#endif /* ATTRIBUTES_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters