From rfg@tristatelogic.com  Sun Jun 10 10:23:47 2012
Return-Path: <rfg@tristatelogic.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 4BBD6106566C
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 10 Jun 2012 10:23:47 +0000 (UTC)
	(envelope-from rfg@tristatelogic.com)
Received: from outgoing.tristatelogic.com (segfault.tristatelogic.com [69.62.255.118])
	by mx1.freebsd.org (Postfix) with ESMTP id 27E028FC08
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 10 Jun 2012 10:23:46 +0000 (UTC)
Received: by segfault.tristatelogic.com (Postfix, from userid 1237)
	id B372E5083A; Sun, 10 Jun 2012 03:23:45 -0700 (PDT)
Message-Id: <20120610102345.B372E5083A@segfault.tristatelogic.com>
Date: Sun, 10 Jun 2012 03:23:45 -0700 (PDT)
From: Ronald F.Guilmette <rfg@tristatelogic.com>
Reply-To: Ronald F.Guilmette <rfg@tristatelogic.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: size of integers used by test(1) and sh(1) is not documented
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         168915
>Category:       docs
>Synopsis:       size of integers used by test(1) and sh(1) is not documented
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 10 10:30:06 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Ronald F. Guilmette
>Release:        FreeBSD 8.3-RELEASE amd64
>Organization:
entropy
>Environment:

8.3-RELEASE

>Description:

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

>How-To-Repeat:

man 1 test
man 1 sh
man 1 builtin

>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)
>Release-Note:
>Audit-Trail:
>Unformatted:
