public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org> 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 Date: Thu, 17 Sep 2020 17:13:26 +0000 (GMT) [thread overview] Message-ID: <20200917171326.1D4C839FE489@sourceware.org> (raw) https://gcc.gnu.org/g:cccc8c2faaf107b43fa8de05ecd1062584c1e474 commit cccc8c2faaf107b43fa8de05ecd1062584c1e474 Author: Jonathan Wakely <jwakely@redhat.com> 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
reply other threads:[~2020-09-17 17:13 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200917171326.1D4C839FE489@sourceware.org \ --to=jakub@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).