From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id 1D4C839FE489; Thu, 17 Sep 2020 17:13:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D4C839FE489 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1600362806; bh=g2/s1gZuUrsiwsJ2xdVR09hto7vH1Mj/qzvradfWxd4=; h=From:To:Subject:Date:From; b=MhRJuNawr7Sl8pdeMMV2fpf6ftZtQ7br6/HEo1YbCxdb2zNtcbhAd110FHxzmSOwG UY6WSf422m/jJglMi2c2SUxmDyt73qjemrnJe1Y6FLVY2ydBHIxLlqRWCzQ8NMtmHE 6yXnvo5TJ0R9fC+e5vqJqNKaM3a7vq+z494a0ajk= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jakub Jelinek To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/redhat/heads/gcc-8-branch)] cpp: Do not use @dots for ... tokens in code examples X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/vendors/redhat/heads/gcc-8-branch X-Git-Oldrev: fb7ca7f5218b956b71f921bc47bb5f7c2706b721 X-Git-Newrev: cccc8c2faaf107b43fa8de05ecd1062584c1e474 Message-Id: <20200917171326.1D4C839FE489@sourceware.org> Date: Thu, 17 Sep 2020 17:13:26 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 17:13:26 -0000 https://gcc.gnu.org/g:cccc8c2faaf107b43fa8de05ecd1062584c1e474 commit cccc8c2faaf107b43fa8de05ecd1062584c1e474 Author: Jonathan Wakely Date: Mon Aug 3 21:16:50 2020 +0100 cpp: Do not use @dots for ... tokens in code examples This prevents a ... token in code examples from being turned into a single HORIZONTAL ELLIPSIS glyph (e.g. via the HTML … entity). gcc/ChangeLog: * doc/cpp.texi (Variadic Macros): Use the exact ... token in code examples. (cherry picked from commit 2ac7fe2769890fe4c146da9cfa6d0eabb185d7db) Diff: --- gcc/doc/cpp.texi | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi index 4297c0ca9ce..6c6ab06b407 100644 --- a/gcc/doc/cpp.texi +++ b/gcc/doc/cpp.texi @@ -1632,7 +1632,7 @@ a function can. The syntax for defining the macro is similar to that of a function. Here is an example: @smallexample -#define eprintf(@dots{}) fprintf (stderr, __VA_ARGS__) +#define eprintf(...) fprintf (stderr, __VA_ARGS__) @end smallexample This kind of macro is called @dfn{variadic}. When the macro is invoked, @@ -1656,11 +1656,11 @@ below for an important special case for @samp{##}.) If your macro is complicated, you may want a more descriptive name for the variable argument than @code{@w{__VA_ARGS__}}. CPP permits this, as an extension. You may write an argument name immediately -before the @samp{@dots{}}; that name is used for the variable argument. +before the @samp{...}; that name is used for the variable argument. The @code{eprintf} macro above could be written @smallexample -#define eprintf(args@dots{}) fprintf (stderr, args) +#define eprintf(args...) fprintf (stderr, args) @end smallexample @noindent @@ -1671,7 +1671,7 @@ You can have named arguments as well as variable arguments in a variadic macro. We could define @code{eprintf} like this, instead: @smallexample -#define eprintf(format, @dots{}) fprintf (stderr, format, __VA_ARGS__) +#define eprintf(format, ...) fprintf (stderr, format, __VA_ARGS__) @end smallexample @noindent @@ -1710,7 +1710,7 @@ invocation expands to its argument; but if the variable argument does not have any tokens, the @code{@w{__VA_OPT__}} expands to nothing: @smallexample -#define eprintf(format, @dots{}) \ +#define eprintf(format, ...) \ fprintf (stderr, format __VA_OPT__(,) __VA_ARGS__) @end smallexample @@ -1723,7 +1723,7 @@ the introduction of @code{@w{__VA_OPT__}}, this extension remains supported in GNU CPP, for backward compatibility. If you write @smallexample -#define eprintf(format, @dots{}) fprintf (stderr, format, ##__VA_ARGS__) +#define eprintf(format, ...) fprintf (stderr, format, ##__VA_ARGS__) @end smallexample @noindent @@ -1759,7 +1759,7 @@ replacement list of a variadic macro. Variadic macros became a standard part of the C language with C99. GNU CPP previously supported them with a named variable argument -(@samp{args@dots{}}, not @samp{@dots{}} and @code{@w{__VA_ARGS__}}), which +(@samp{args...}, not @samp{...} and @code{@w{__VA_ARGS__}}), which is still supported for backward compatibility. @node Predefined Macros