Skip to content

Commit fa94dd3

Browse files
jorgenclaude
andcommitted
fix(build): guard umul128 __int128 usage with __extension__ for -Wpedantic
The Linux Debug CI job compiles with -Wpedantic -Werror. The unsigned __int128 declaration and casts in umul128 tripped -Werror=pedantic ("ISO C++ does not support __int128"), breaking the build. Introduce a local __extension__ typedef and cast through it, matching the existing __extension__ idiom used for js_int128_t/js_uint128_t, so the only mention of __int128 is on a line covered by __extension__. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent cc049cb commit fa94dd3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎include/json_struct/json_struct.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7497,7 +7497,8 @@ inline void compute_shortest(uint64_t a, uint64_t b, uint64_t c, bool accept_sma
74977497
static inline uint64_t umul128(uint64_t a, uint64_t b, uint64_t *hi)
74987498
{
74997499
#if defined(__SIZEOF_INT128__) && !defined(FT_NO_INT128)
7500-
unsigned __int128 p = (unsigned __int128)a * (unsigned __int128)b;
7500+
__extension__ typedef unsigned __int128 js_umul128_u128;
7501+
js_umul128_u128 p = (js_umul128_u128)a * (js_umul128_u128)b;
75017502
*hi = uint64_t(p >> 64);
75027503
return uint64_t(p);
75037504
#elif defined(_MSC_VER) && defined(_WIN64)

0 commit comments

Comments
 (0)