public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug pch/47857] Pragma once warning when compiling PCH
Date: Tue, 14 Nov 2023 22:55:12 +0000	[thread overview]
Message-ID: <bug-47857-4-i0xaBpd99t@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-47857-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47857

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Lewis Hyatt <lhyatt@gcc.gnu.org>:

https://gcc.gnu.org/g:9938645fcf914ec2a3fa8137cf1456ad4af5f77c

commit r14-5471-g9938645fcf914ec2a3fa8137cf1456ad4af5f77c
Author: Lewis Hyatt <lhyatt@gmail.com>
Date:   Fri Nov 10 11:10:18 2023 -0500

    c-family: Let libcpp know when the compilation is for a PCH [PR9471]

    libcpp will generate diagnostics when it encounters things in the main file
    that only belong in a header file, such as `#pragma once' or `#pragma GCC
    system_header'. But sometimes the main file is a header file that is just
    being compiled separately, e.g. to produce a C++ module or a PCH, in which
    case such diagnostics should be suppressed. libcpp already has an interface
    to request that, so make use of it in the C frontends to prevent libcpp
from
    issuing unwanted diagnostics when compiling a PCH.

    gcc/c-family/ChangeLog:

            PR pch/9471
            PR pch/47857
            * c-opts.cc (c_common_post_options): Set cpp_opts->main_search
            so libcpp knows it is compiling a header file separately.

    gcc/testsuite/ChangeLog:

            PR pch/9471
            PR pch/47857
            * g++.dg/pch/main-file-warnings.C: New test.
            * g++.dg/pch/main-file-warnings.Hs: New test.
            * gcc.dg/pch/main-file-warnings.c: New test.
            * gcc.dg/pch/main-file-warnings.hs: New test.

  parent reply	other threads:[~2023-11-14 22:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-23 12:32 [Bug preprocessor/47857] New: " olafvdspek at gmail dot com
2011-12-15  2:15 ` [Bug preprocessor/47857] " pinskia at gcc dot gnu.org
2011-12-15 10:47 ` olafvdspek at gmail dot com
2011-12-15 13:40 ` redi at gcc dot gnu.org
2012-04-28 14:40 ` olafvdspek at gmail dot com
2013-10-03 17:42 ` ripzonetriton at gmail dot com
2015-01-07  0:25 ` p_hampson at wargaming dot net
2023-08-24  8:31 ` [Bug pch/47857] " egallager at gcc dot gnu.org
2023-11-14 22:55 ` cvs-commit at gcc dot gnu.org [this message]
2023-11-14 22:58 ` lhyatt at gcc dot gnu.org
2024-02-11 10:29 ` pinskia at gcc dot gnu.org

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=bug-47857-4-i0xaBpd99t@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).