Skip to content

Commit ad55c4f

Browse files
committed
bswap is not a library function; use __builtin_bswap[bit-suffix] instead
1 parent f6509c3 commit ad55c4f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ansi-c/expr2c.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3532,7 +3532,11 @@ std::string expr2ct::convert_with_precedence(
35323532
return convert_function(src, "isinf", precedence=16);
35333533

35343534
else if(src.id()==ID_bswap)
3535-
return convert_function(src, "bswap", precedence=16);
3535+
return convert_function(
3536+
src,
3537+
"__builtin_bswap"+
3538+
integer2string(pointer_offset_bits(src.op0().type(), ns)),
3539+
precedence=16);
35363540

35373541
else if(src.id()==ID_isnormal)
35383542
return convert_function(src, "isnormal", precedence=16);

0 commit comments

Comments
 (0)