On Fri, 7 Mar 2025, Jakub Jelinek wrote:
> 2025-03-07  Jakub Jelinek  <[email protected]>
> 
>       PR c/112960
>       PR c/117029
>       * extend.texi (Complex): Add I and J suffixes to the list of
>       complex suffixes, adjust for all of those being part of ISO C2Y,
>       clarify that for -fno-ext-numeric-literals none of those are
>       recognized as GNU extensions and for C++14 i is considered UDL
>       even for -fext-numeric-literals when <complex> is included.

On Fri, 7 Mar 2025, Sandra Loosemore wrote:
> Thanks for helping straighten this out!

Indeed!

> OK with those changes.

How about the following additional tweaks?

(Essentially Oxford commas, "pure -> purely", "or" -> "and" in one case,
"but" -> "and" in another to make things a bit smoother.)

Gerald



>From e24134917a9e7a24af438e52a8554e5ad6c68482 Mon Sep 17 00:00:00 2001
From: Gerald Pfeifer <[email protected]>
Date: Sat, 24 Oct 2026 18:14:10 +0200
Subject: [PATCH] doc: Refine description of imaginary constants

gcc:
        PR c/112960
        PR c/117029
        * doc/extend.texi (Complex): Refine description of imaginary
        constants.
---
 gcc/doc/extend.texi | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index a511ffe66a8..827876e78ee 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -118,11 +118,11 @@ have real and imaginary parts of type @code{short int}; 
this is not
 likely to be useful, but it shows that the set of complex types is
 complete.
 
-To write a constant with a complex data type, use the suffix @samp{i},
-@samp{I}, @samp{j} or @samp{J} (any one; they are equivalent).  For
+To write a constant with a complex data type, use any of the suffixes
+@samp{i}, @samp{I}, @samp{j}, or @samp{J} (which are equivalent).  For
 example, @code{2.5fi} has type @code{_Complex float} and @code{3i} has type
-@code{_Complex int}.  Such a constant always has a pure imaginary
-value, but you can form any complex value you like by adding one to a
+@code{_Complex int}.  Such a constant always has a purely imaginary
+value, and you can form any complex value you like by adding it to a
 real constant.  This is part of ISO C2Y and for older C revisions
 a GNU extension.  If you have an ISO C99 conforming C library
 (such as the GNU C Library), and want to construct complex
@@ -134,7 +134,7 @@ For C++ if @code{-fext-numeric-literals} option is enabled, 
it is also
 a GNU extension, otherwise it is handled like any other C++ user-defined
 literal.  The ISO C++14 library also defines the @samp{i} suffix, so C++14
 code that includes the @samp{<complex>} header cannot use @samp{i} for the
-GNU extension.  The @samp{I}, @samp{j} or @samp{J} suffixes still have
+GNU extension.  The @samp{I}, @samp{j}, and @samp{J} suffixes still have
 the GNU meaning.
 
 GCC handles both implicit and explicit casts between the
-- 
2.56.0

Reply via email to