Skip to content

Commit

Permalink
The return type of __builtin_clz() et al is "int", as documented and …
Browse files Browse the repository at this point in the history
…for GCC compatibility, and not "unsigned int", as previously implemented.
  • Loading branch information
xavierleroy committed Dec 21, 2015
1 parent 6423f12 commit 7a85585
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Miscellaneous:
passing a struct/union as function argument is now rejected.
- The -fstruct-return command-line option is deprecated and
becomes a synonymous for -fstruct-passing.
- The return type of __builtin_clz() is "int", as documented,
and not "unsigned int", as previously implemented.


Release 2.5, 2015-06-12
Expand Down
2 changes: 1 addition & 1 deletion arm/CBuiltins.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let builtins = {
"__builtin_bswap16",
(TInt(IUShort, []), [TInt(IUShort, [])], false);
"__builtin_clz",
(TInt(IUInt, []), [TInt(IUInt, [])], false);
(TInt(IInt, []), [TInt(IUInt, [])], false);
(* Float arithmetic *)
"__builtin_fsqrt",
(TFloat(FDouble, []), [TFloat(FDouble, [])], false);
Expand Down
4 changes: 2 additions & 2 deletions ia32/CBuiltins.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ let builtins = {
"__builtin_bswap16",
(TInt(IUShort, []), [TInt(IUShort, [])], false);
"__builtin_clz",
(TInt(IUInt, []), [TInt(IUInt, [])], false);
(TInt(IInt, []), [TInt(IUInt, [])], false);
"__builtin_ctz",
(TInt(IUInt, []), [TInt(IUInt, [])], false);
(TInt(IInt, []), [TInt(IUInt, [])], false);
(* Float arithmetic *)
"__builtin_fsqrt",
(TFloat(FDouble, []), [TFloat(FDouble, [])], false);
Expand Down
6 changes: 3 additions & 3 deletions powerpc/CBuiltins.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ let builtins = {
"__builtin_mulhwu",
(TInt(IUInt, []), [TInt(IUInt, []); TInt(IUInt, [])], false);
"__builtin_clz",
(TInt(IUInt, []), [TInt(IUInt, [])], false);
(TInt(IInt, []), [TInt(IUInt, [])], false);
"__builtin_clzl",
(TInt(IUInt, []), [TInt(IULong, [])], false);
(TInt(IInt, []), [TInt(IULong, [])], false);
"__builtin_clzll",
(TInt(IUInt, []), [TInt(IULongLong, [])], false);
(TInt(IInt, []), [TInt(IULongLong, [])], false);
"__builtin_bswap",
(TInt(IUInt, []), [TInt(IUInt, [])], false);
"__builtin_bswap32",
Expand Down

0 comments on commit 7a85585

Please sign in to comment.