Skip to content

Conversation

@rustyrussell
Copy link
Contributor

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
Changelog-None: broken only in master.

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 <[email protected]>
@rustyrussell rustyrussell added this to the v25.12 milestone Oct 23, 2025
@rustyrussell rustyrussell merged commit f40ff1d into ElementsProject:master Oct 24, 2025
32 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant