git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
Cc: "Git ML" <git@vger.kernel.org>, Jeff King <peff@peff.net>
Subject: Will -fsyntax-only hide issues with -pedantic? I think not...
Date: Tue, 30 Nov 2021 14:13:11 +0100	[thread overview]
Message-ID: <211130.86ilw9epy3.gmgdl@evledraar.gmail.com> (raw)

The answer to $subject is not at all urgent, but I noticed we can get
some (very modest) speed increases in the "pedantic" CI job when adding
-fsyntax-only to CFLAGS. This currently requires monkeypatching out the
"-o <target> -c" part hardcoded in the Makefile. See cebead1ebfb (ci:
run a pedantic build as part of the GitHub workflow, 2021-08-08) for the
pedantic job.

I.e. I'm aware of CFLAGS's -O<n> changing which warings we emit, but
does -fsyntax-only?

The gcc manpage suggests that it would, saying:

    Check the code for syntax errors, but don't do anything beyond that

Whereas clang's says:

    Run the preprocessor, parser and type checking stages. 

I think gcc's is a case of its docs drifting out of sync with the
implementation. Both will warn on e.g. this program under -pedantic,
which gcc wouldn't be doing if it only did syntax parsing (and didn't
run the warning machinery):
    
    int main(void)
    {
            int v[0];
            return 0;
    }

I don't have any practical use for this now. We could squeeze some
slight performance out of one CI jobs, but perhaps it'll be more
interesting in the future.

             reply	other threads:[~2021-11-30 13:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 13:13 Ævar Arnfjörð Bjarmason [this message]
2021-11-30 21:02 ` Will -fsyntax-only hide issues with -pedantic? I think not Jeff King

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=211130.86ilw9epy3.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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 NNTP newsgroup(s).