AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 15 Bitcoin

lightningd: fix compilation for older compilers.

Public commit record

What the developer wrote

Authored by Rusty Russell

68/100 · Adequate
lightningd: fix compilation for older compilers.

gcc 9.3.0-10 (Ubunto Focal):

```
cc lightningd/offer.c
In file included from ccan/ccan/cast/cast.h:6,
from lightningd/offer.c:2:
lightningd/offer.c: In function 'json_createoffer':
ccan/ccan/cast/cast.h:115:13: error: dereferencing pointer to incomplete type 'struct json_escape'
115 | __typeof__(**(union { int z; __typeof__(expr) x; }){0}.x)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ccan/ccan/build_assert/build_assert.h:38:24: note: in definition of macro 'BUILD_ASSERT_OR_ZERO'
38 | (sizeof(char [1 - 2*!(cond)]) - 1)
| ^~~~
ccan/ccan/cast/cast.h:122:31: note: in expansion of macro 'cast_const_strip2'
122 | __builtin_types_compatible_p(cast_const_strip2(expr), \
| ^~~~~~~~~~~~~~~~~
ccan/ccan/cast/cast.h:59:35: note: in expansion of macro 'cast_const_compat2'
59 | (0 ? BUILD_ASSERT_OR_ZERO(cast_const_compat2((expr), type)) : \
| ^~~~~~~~~~~~~~~~~~
lightningd/offer.c:105:12: note: in expansion of macro 'cast_const2'
105 | cast_const2(const struct json_escape **,
| ^~~~~~~~~~~
ccan/ccan/cast/cast.h:115:13: error: dereferencing pointer to incomplete type 'const struct json_escape'
115 | __typeof__(**(union { int z; __typeof__(expr) x; }){0}.x)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ccan/ccan/build_assert/build_assert.h:38:24: note: in definition of macro 'BUILD_ASSERT_OR_ZERO'
38 | (sizeof(char [1 - 2*!(cond)]) - 1)
| ^~~~
ccan/ccan/cast/cast.h:123:10: note: in expansion of macro 'cast_const_strip2'
123 | cast_const_strip2(type))
| ^~~~~~~~~~~~~~~~~
ccan/ccan/cast/cast.h:59:35: note: in expansion of macro 'cast_const_compat2'
59 | (0 ? BUILD_ASSERT_OR_ZERO(cast_const_compat2((expr), type)) : \
| ^~~~~~~~~~~~~~~~~~
lightningd/offer.c:105:12: note: in expansion of macro 'cast_const2'
105 | cast_const2(const struct json_escape **,
| ^~~~~~~~~~~
make: *** [Makefile:320: lightningd/offer.o] Error 1
```

Reported-by: Shahana
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

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.

Recommended action

No security action needed. This is a build-compatibility fix.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 15/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 10/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.