Bug 168915

Summary: size of integers used by test(1) and sh(1) is not documented
Product: Documentation Reporter: Ronald F. Guilmette <rfg>
Component: Manual PagesAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me CC: doc
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Ronald F. Guilmette 2012-06-10 11:30:06 UTC
I just noticed that whereas the man page for the expr(1) command goes to
some trouble to precisely document the size of integers it uses for all of
its calculations (both with and without the -e option) there is no equivalent
documentation present in the case of the test(1) command or its sh(1)
builtin equivalent.  (See also the "Arithmetic Expansion" section of the
sh(1) man page, where the issue also arises.)

I think that both the test(1) man page and the sh(1) man page should specify
the size of integers used by these programs, and also whether or not the
internal integers used are treated as being signed or not.

It would be Nice to know if the following shell code will or will not
necessarily produce ``correct'' results...

if [ "$x" != 5000000000 ] ; then
  echo Too big to fail\!
fi

Fix: 

I dunno what the proper fix is.  Probably just add some verbage to both
man pages along the lines of what is in the expr(1) man page.  But that is
just a guess.

Maybe something about the size of the ints should also be mentioned in
the following additional man pages as well:

builtin(1)
csh(1)
tcsh(1)
bash(1)
How-To-Repeat: 
man 1 test
man 1 sh
man 1 builtin
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:45 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped