This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Prefer C99 names for "long long" limits


On Tue, 21 Feb 2012, Roland McGrath wrote:

> I agree with making the standard names the primary suggestion.
> But I think the GNU names should appear with @comment GNU @itemx
> so that summary.awk finds them.

That makes the wording describing the max macros more awkward, since it's 
now following a list of four rather than two, but here is a version that 
lists the GNU names like that.

2012-02-22  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 e160438..e59da41 100644
--- a/manual/arith.texi
+++ b/manual/arith.texi
@@ -2131,7 +2131,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 9bc9871..5ad734e 100644
--- a/manual/lang.texi
+++ b/manual/lang.texi
@@ -827,23 +827,42 @@ 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 ISO
+@item LLONG_MIN
+@comment limits.h
 @comment GNU
-@item LONG_LONG_MIN
+@itemx LONG_LONG_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 ULLONG_MAX
+@comment GNU
+@comment limits.h
+@itemx LONG_LONG_MAX
+@comment GNU
+@comment limits.h
 @itemx ULONG_LONG_MAX
 
-These are the maximum values that can be represented by a @code{signed
+@code{LLONG_MAX} and @code{ULLONG_MAX} are the maximum values that can
+be represented by a @code{signed
 long long int} and @code{unsigned long long int}, respectively.
 
+@code{LLONG_MAX} and @code{ULLONG_MAX} 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]