Skip to content

Commit

Permalink
Merge branch 'micro5k:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git authored Oct 19, 2024
2 parents 3e65ddf + 23248e6 commit 1124f89
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions tools/bits-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,11 @@ get_version()
printf '%s\n' "${_version}"
}

get_max_unsigned_int_of_shell_printf()
{
printf '%u\n' '-1'
}

pause_if_needed()
{
# shellcheck disable=SC3028 # In POSIX sh, SHLVL is undefined
Expand All @@ -813,10 +818,10 @@ main()
_limits_date='32767 2147480047 2147483647 32535215999 32535244799 67767976233529199 67767976233532799 67768036191673199 67768036191676799 9223372036854775807'
_limits_u='65535 2147483647 2147483648 4294967295 18446744073709551615'

shell_exe="$(get_shell_exe)" || :
shell_exe="$(get_shell_exe || :)"
if test "$(uname 2> /dev/null -o || :)" = 'Msys' && command 1> /dev/null 2>&1 -v 'cygpath'; then shell_exe="$(cygpath -m -a -l -- "${shell_exe}" || :)"; fi
shell_info="$(get_shell_info "${shell_exe}")" || :
shell_name="$(printf '%s\n' "${shell_info}" | cut -d ' ' -f '1')" || :
shell_info="$(get_shell_info "${shell_exe}" || :)"
shell_name="$(printf '%s\n' "${shell_info}" | cut -d ' ' -f '1' || :)"

printf '%s %s\n' "Shell:" "${shell_name}"
if shell_applet="$(get_applet_name "${shell_name}")"; then
Expand Down Expand Up @@ -903,14 +908,12 @@ main()
done
_shell_arithmetic_bit="$(convert_max_signed_int_to_bit "${_max}")" || _shell_arithmetic_bit='unknown'

{
# Some shells do NOT allow this, so we hide the errors
tmp_var="$(printf '%u\n' '-1')" || :
} 2> /dev/null
_shell_printf_bit="$(convert_max_unsigned_int_to_bit "${tmp_var}")" || :
# Some shells do NOT allow this, so we hide the errors
tmp_var="$(get_max_unsigned_int_of_shell_printf 2> /dev/null || :)"
_shell_printf_bit="$(convert_max_unsigned_int_to_bit "${tmp_var}" || :)"

tmp_var="$(awk -- 'BEGIN { printf "%u\n", "-1" }')" || :
_awk_printf_bit="$(convert_max_unsigned_int_to_bit "${tmp_var}")" || :
tmp_var="$(awk -- 'BEGIN { printf "%u\n", "-1" }' || :)"
_awk_printf_bit="$(convert_max_unsigned_int_to_bit "${tmp_var}" || :)"

# IMPORTANT: For very big integer numbers GNU Awk may return the exponential notation or an imprecise number
_max='-1'
Expand Down

0 comments on commit 1124f89

Please sign in to comment.