From 2a0a62859c02667b4a86c1c4c1d2875f85e78b6f Mon Sep 17 00:00:00 2001 From: "nilesh.kale" Date: Tue, 2 Apr 2024 18:10:39 +0530 Subject: [PATCH 1/2] Fixed issue of redefinition warning messages for _GNU_SOURCE Signed-off-by: nilesh.kale --- .../fix-redefination_warning_messages_for_GNU_SOURCE.txt | 5 +++++ library/entropy_poll.c | 4 +++- library/sha256.c | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 ChangeLog.d/fix-redefination_warning_messages_for_GNU_SOURCE.txt diff --git a/ChangeLog.d/fix-redefination_warning_messages_for_GNU_SOURCE.txt b/ChangeLog.d/fix-redefination_warning_messages_for_GNU_SOURCE.txt new file mode 100644 index 000000000000..ce2e9d57e445 --- /dev/null +++ b/ChangeLog.d/fix-redefination_warning_messages_for_GNU_SOURCE.txt @@ -0,0 +1,5 @@ +Bugfix + * Fix issue of redefinition warning messages for _GNU_SOURCE in + entropy_poll.c and sha_256.c. There was a build warning during + building for linux platform. + Resolves #9026 \ No newline at end of file diff --git a/library/entropy_poll.c b/library/entropy_poll.c index 794ee03a831b..611768cd8556 100644 --- a/library/entropy_poll.c +++ b/library/entropy_poll.c @@ -5,10 +5,12 @@ * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ -#if defined(__linux__) || defined(__midipix__) && !defined(_GNU_SOURCE) +#if defined(__linux__) || defined(__midipix__) /* Ensure that syscall() is available even when compiling with -std=c99 */ +#if !defined(_GNU_SOURCE) #define _GNU_SOURCE #endif +#endif #include "common.h" diff --git a/library/sha256.c b/library/sha256.c index 87889817a4ea..8b2c34526ba3 100644 --- a/library/sha256.c +++ b/library/sha256.c @@ -44,7 +44,9 @@ #endif /* defined(__clang__) && (__clang_major__ >= 4) */ /* Ensure that SIG_SETMASK is defined when -std=c99 is used. */ +#if !defined(_GNU_SOURCE) #define _GNU_SOURCE +#endif #include "common.h" From 7fa3134dab93b0cf3b6c05b1923fb1d015fa1f8e Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Tue, 30 Apr 2024 09:09:30 +0100 Subject: [PATCH 2/2] Fix Changelog formatting Add EOL and remove trailing whitespaces. Signed-off-by: Janos Follath --- .../fix-redefination_warning_messages_for_GNU_SOURCE.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog.d/fix-redefination_warning_messages_for_GNU_SOURCE.txt b/ChangeLog.d/fix-redefination_warning_messages_for_GNU_SOURCE.txt index ce2e9d57e445..b5c26505c2b6 100644 --- a/ChangeLog.d/fix-redefination_warning_messages_for_GNU_SOURCE.txt +++ b/ChangeLog.d/fix-redefination_warning_messages_for_GNU_SOURCE.txt @@ -1,5 +1,5 @@ Bugfix - * Fix issue of redefinition warning messages for _GNU_SOURCE in - entropy_poll.c and sha_256.c. There was a build warning during + * Fix issue of redefinition warning messages for _GNU_SOURCE in + entropy_poll.c and sha_256.c. There was a build warning during building for linux platform. - Resolves #9026 \ No newline at end of file + Resolves #9026