[winpr,platform] fall back to attribute for GCC

GCC does not like [[nodiscard]] on function pointers. Fall back to
attribute(warn_unused_result) syntax, which does seem to work.
This commit is contained in:
Armin Novak
2026-02-25 11:24:09 +01:00
parent 1366f0d646
commit 88e8c843f9

View File

@@ -95,6 +95,14 @@
#define WINPR_ATTR_NODISCARD
#endif
/* GCC does not like [[nodiscard]] on function pointers.
* it does not complain when using attribute syntax thoug...
*/
#if defined(__GNUC__) && !defined(__clang__)
#undef WINPR_ATTR_NODISCARD
#define WINPR_ATTR_NODISCARD __attribute__((warn_unused_result))
#endif
#if defined(__clang__)
#define WINPR_PRAGMA_DIAG_PUSH WINPR_DO_PRAGMA(clang diagnostic push)
#define WINPR_PRAGMA_DIAG_IGNORED_OVERLENGTH_STRINGS \