Skip to content

Commit 7a85585

Browse files
committed
The return type of __builtin_clz() et al is "int", as documented and for GCC compatibility, and not "unsigned int", as previously implemented.
1 parent 6423f12 commit 7a85585

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

Changelog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ Miscellaneous:
4545
passing a struct/union as function argument is now rejected.
4646
- The -fstruct-return command-line option is deprecated and
4747
becomes a synonymous for -fstruct-passing.
48+
- The return type of __builtin_clz() is "int", as documented,
49+
and not "unsigned int", as previously implemented.
4850

4951

5052
Release 2.5, 2015-06-12

arm/CBuiltins.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ let builtins = {
3030
"__builtin_bswap16",
3131
(TInt(IUShort, []), [TInt(IUShort, [])], false);
3232
"__builtin_clz",
33-
(TInt(IUInt, []), [TInt(IUInt, [])], false);
33+
(TInt(IInt, []), [TInt(IUInt, [])], false);
3434
(* Float arithmetic *)
3535
"__builtin_fsqrt",
3636
(TFloat(FDouble, []), [TFloat(FDouble, [])], false);

ia32/CBuiltins.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ let builtins = {
3030
"__builtin_bswap16",
3131
(TInt(IUShort, []), [TInt(IUShort, [])], false);
3232
"__builtin_clz",
33-
(TInt(IUInt, []), [TInt(IUInt, [])], false);
33+
(TInt(IInt, []), [TInt(IUInt, [])], false);
3434
"__builtin_ctz",
35-
(TInt(IUInt, []), [TInt(IUInt, [])], false);
35+
(TInt(IInt, []), [TInt(IUInt, [])], false);
3636
(* Float arithmetic *)
3737
"__builtin_fsqrt",
3838
(TFloat(FDouble, []), [TFloat(FDouble, [])], false);

powerpc/CBuiltins.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ let builtins = {
2929
"__builtin_mulhwu",
3030
(TInt(IUInt, []), [TInt(IUInt, []); TInt(IUInt, [])], false);
3131
"__builtin_clz",
32-
(TInt(IUInt, []), [TInt(IUInt, [])], false);
32+
(TInt(IInt, []), [TInt(IUInt, [])], false);
3333
"__builtin_clzl",
34-
(TInt(IUInt, []), [TInt(IULong, [])], false);
34+
(TInt(IInt, []), [TInt(IULong, [])], false);
3535
"__builtin_clzll",
36-
(TInt(IUInt, []), [TInt(IULongLong, [])], false);
36+
(TInt(IInt, []), [TInt(IULongLong, [])], false);
3737
"__builtin_bswap",
3838
(TInt(IUInt, []), [TInt(IUInt, [])], false);
3939
"__builtin_bswap32",

0 commit comments

Comments
 (0)