public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kaz Kylheku <kaz@kylheku.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] cpp: new built-in __EXP_COUNTER__
Date: Mon, 18 Mar 2024 09:39:32 -0700	[thread overview]
Message-ID: <945d70a9fab2478b16158b207a311619@kylheku.com> (raw)
In-Reply-To: <ZfftjveFral9Pyjx@zen.kayari.org>

On 2024-03-18 00:30, Jonathan Wakely wrote:
>>+@item __EXP_COUNTER__
>>+This macro's name means "(macro) expansion counter".
>>+Outside of macro replacement sequences, it expands to the integer
>>+token @code{1}.  This make it possible to easily test for the presence
>>+of this feature using conditional directives such as
>>+@code{#if __EXP_COUNTER__}.
> 
> It's a macro, so you can just use '#ifdef __EXP_COUNTER__' to test if
> it's supported. Is this additional behaviour necessary?

Thanks for looking at the patch.

The macro has to be defined, but it doesn't have to be 1.

Outside a macro body, it could just appear defined
with an empty value, as if by #define __EXP_COUNTER__.

When I dump the predefined macros of a nearby GCC installation, I
see very few empty ones:

   $ echo | gcc -dM -E - | awk 'NF == 2'
   #define __USER_LABEL_PREFIX__
   #define __REGISTER_PREFIX__

The __EXP_COUNTER__ and __UEXP_COUNTER__ symbols are
intended for suffix and infix use, so they are roughly in
a kind of category with those those two.

I will make that change, and also fix the grammar error
and remove the conflict-promoting ChangeLog changes.

  parent reply	other threads:[~2024-03-18 16:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 11:31 Kaz Kylheku
2024-03-18  7:30 ` Jonathan Wakely
2024-03-18  7:32   ` Jonathan Wakely
2024-03-18 16:39   ` Kaz Kylheku [this message]
2024-03-18 19:28     ` Jonathan Wakely
2024-03-19 17:27   ` Kaz Kylheku
2024-03-20 23:34     ` rep.dot.nop
2024-03-22  0:18       ` Kaz Kylheku
2024-03-22  1:40         ` Andrew Pinski
2024-03-22  6:03           ` Kaz Kylheku

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=945d70a9fab2478b16158b207a311619@kylheku.com \
    --to=kaz@kylheku.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    /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: link
Be 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).