Skip to content

Commit 6686568

Browse files
author
LN882H Fix
committed
[lightning-ln882h] Fix -Wregister warnings from CmBacktrace cmb_def.h (#376)
The LN882H SDK's CmBacktrace library (cmb_def.h) uses the 'register' storage class specifier in inline assembly helpers (cmb_get_msp/psp/sp). This keyword was removed in C++17 (P0001R1) and produces -Wregister warnings when compiling with -std=c++17. Add a fixup header that wraps the original cmb_def.h with GCC diagnostic pragmas to suppress the warning without modifying SDK sources.
1 parent ea5142d commit 6686568

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

cores/lightning-ln882h/base/sdk_private.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,15 @@ extern "C" {
4848
// SDK
4949
#include "ln_kv_api.h"
5050
#include "ln_nvds.h"
51+
// cmb_def.h uses 'register' (removed in C++17); suppress -Wregister in C++ only
52+
#ifdef __cplusplus
53+
#pragma GCC diagnostic push
54+
#pragma GCC diagnostic ignored "-Wregister"
55+
#endif
5156
#include "utils/debug/CmBacktrace/cm_backtrace.h"
57+
#ifdef __cplusplus
58+
#pragma GCC diagnostic pop
59+
#endif
5260
#include "utils/ln_psk_calc.h"
5361
#include "utils/power_mgmt/ln_pm.h"
5462
#include "utils/reboot_trace/reboot_trace.h"

0 commit comments

Comments
 (0)