public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tom Kacvinsky <tkacvins@gmail.com>
To: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: Difference in -E output
Date: Thu, 27 Oct 2022 18:33:26 -0400	[thread overview]
Message-ID: <CAG_eJLdqrE9E=DFJQwYFbbO1qpf-3+qoZYnGNSaQhAPiDGp3Dg@mail.gmail.com> (raw)
In-Reply-To: <20221027222827.GD25951@gate.crashing.org>

[-- Attachment #1: Type: text/plain, Size: 1272 bytes --]

On Thu, Oct 27, 2022 at 6:30 PM Segher Boessenkool <
segher@kernel.crashing.org> wrote:

> On Thu, Oct 27, 2022 at 04:22:11PM -0400, Tom Kacvinsky via Gcc-help wrote:
> > I am working on an issue that involves our tool depending on the
> > preprocessed output from gcc -E.
>
> > # 4 "test.c" 3 4
> >
> >         0
> >
> > # 4 "test.c"
> >
> >                     ;
> >
> > }
> >
> >
> > Notice how when the macro EXIT_SUCCESS is expanded, we get several lines
> > around the 0?
>
> I don't get any of the blank lines you have though?
>
> > This is happening for us with GCC 8.3.  But using something as early as
> > 4.8.5 (yeah, I know,
> >
> > bad idea), we get this:
> >
> >
> > int main() {
> >
> >   return 0;
> >
> > }
> >
> >
> > I am pretty sure this is an intentional change.  What I'd like to know is
> > if there is a way of
> >
> > reverting back to the former behavior?  I looked at
>
> -P will do what you want (as a side effect though).  -traditional also
> works (and that one is more intentional).  Neither of those does *only*
> this, but either may be usable for your purposes.
>

A colleague informed me that -ftrack-macro-expansion=0 does exactly what I
want.

Said colleague also told me to call them the next time a question like this
came up.  Haha

      reply	other threads:[~2022-10-27 22:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27 20:22 Tom Kacvinsky
2022-10-27 22:28 ` Segher Boessenkool
2022-10-27 22:33   ` Tom Kacvinsky [this message]

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='CAG_eJLdqrE9E=DFJQwYFbbO1qpf-3+qoZYnGNSaQhAPiDGp3Dg@mail.gmail.com' \
    --to=tkacvins@gmail.com \
    --cc=gcc-help@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: 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).