lightningd: fix compilation for older compilers.
What changed, and why it matters
This commit fixes a build failure on older GCC compilers by adding a missing header file. It does not change runtime behavior or fix any security vulnerability.
No security action needed. This is a build-compatibility fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit adds #include <ccan/json_escape/json_escape.h> to lightningd/offer.c. The cast_const2 macro in ccan/cast/cast.h dereferences a pointer to determine types at compile time, which requires struct json_escape to be a complete type. On Ubuntu Focal’s gcc 9.3.0-10, the incomplete type caused a compilation error. Including the header provides the full definition, allowing the build to succeed. There is no functional code change.
Changed components
lightningd/offer.cInspect captured patch +1 / −0
diff --git a/lightningd/offer.c b/lightningd/offer.c
index dd8871cb..27996281 100644
--- a/lightningd/offer.c
+++ b/lightningd/offer.c
@@ -1,5 +1,6 @@
#include "config.h"
#include <ccan/cast/cast.h>
+#include <ccan/json_escape/json_escape.h> /* Ubuntu focal's gcc needs json_escape defined */
#include <common/bolt12_id.h>
#include <common/bolt12_merkle.h>
#include <common/json_command.h>
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.