This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Prefer C99 names for "long long" limits
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: libc-alpha at sourceware dot org
- Date: Fri, 17 Feb 2012 22:54:30 +0000 (UTC)
- Subject: Prefer C99 names for "long long" limits
Bug 5461 notes that the glibc manual refers to old macro names such as
LONG_LONG_MIN instead of the ISO C99 LLONG_MIN. I propose this patch
which refers primarily to the new names, only mentioning the old names
as older GCC-specific names that may be relevant for compatibility
with pre-3.0 GCC.
2012-02-17 Joseph Myers <joseph@codesourcery.com>
[BZ #5461]
* manual/arith.texi (strtoll): Refer to LLONG_MAX and LLONG_MIN,
not LONG_LONG_MAX and LONG_LONG_MIN.
* manual/lang.texi (LONG_LONG_MIN): Document first as ISO
LLONG_MIN. Refer to LONG_LONG_MIN only as older GCC-specific
name.
(LONG_LONG_MAX, LLONG_MAX, ULONG_LONG_MAX, ULLONG_MAX): Likewise.
diff --git a/manual/arith.texi b/manual/arith.texi
index c5795c2..6b83bb0 100644
--- a/manual/arith.texi
+++ b/manual/arith.texi
@@ -2135,7 +2135,7 @@ larger range.
If the string has valid syntax for an integer but the value is not
representable because of overflow, @code{strtoll} returns either
-@code{LONG_LONG_MAX} or @code{LONG_LONG_MIN} (@pxref{Range of Type}), as
+@code{LLONG_MAX} or @code{LLONG_MIN} (@pxref{Range of Type}), as
appropriate for the sign of the value. It also sets @code{errno} to
@code{ERANGE} to indicate there was overflow.
diff --git a/manual/lang.texi b/manual/lang.texi
index 82c5e96..dae325c 100644
--- a/manual/lang.texi
+++ b/manual/lang.texi
@@ -827,23 +827,31 @@ These are the maximum values that can be represented by a
@w{@code{signed long int}} and @code{unsigned long int}, respectively.
@comment limits.h
-@comment GNU
-@item LONG_LONG_MIN
+@comment ISO
+@item LLONG_MIN
This is the minimum value that can be represented by a @w{@code{signed
long long int}}. On most machines that the GNU C system runs on,
@w{@code{long long}} integers are 64-bit quantities.
+@code{LLONG_MIN} is the ISO C name for this value. An older
+GCC-specific name, only available if @code{_GNU_SOURCE} is defined, is
+@code{LONG_LONG_MIN}; this was the only name available with GCC
+versions before 3.0.
+
@comment limits.h
-@comment GNU
-@item LONG_LONG_MAX
+@comment ISO
+@item LLONG_MAX
@comment limits.h
@comment ISO
-@itemx ULONG_LONG_MAX
+@itemx ULLONG_MAX
These are the maximum values that can be represented by a @code{signed
long long int} and @code{unsigned long long int}, respectively.
+These are the ISO C names for these values; the corresponding older
+GCC-specific names are @code{LONG_LONG_MAX} and @code{ULONG_LONG_MAX}.
+
@comment limits.h
@comment GNU
@item WCHAR_MAX
--
Joseph S. Myers
joseph@codesourcery.com