public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: "Marc Nieper-Wißkirchen" <marc.nieper+gnu@gmail.com>,
	"Marc Nieper-Wißkirchen via Jit" <jit@gcc.gnu.org>
Subject: Re: Portability requirements of libgccjit++.h
Date: Mon, 31 Jan 2022 09:37:04 -0500	[thread overview]
Message-ID: <63567678b4b477cab962c021e1970737521eab0d.camel@redhat.com> (raw)
In-Reply-To: <CAEYrNrTGNXbx6C=URFPev28eVFirv__oOd2KHfR0H9Cuzptwcw@mail.gmail.com>

On Mon, 2022-01-31 at 10:39 +0100, Marc Nieper-Wißkirchen via Jit
wrote:
> The GCC project has the following portability requirements ([1]):
> 
> "The directories gcc, libcpp and fixincludes may use C++03. They may
> also
> use the long long type if the host C++ compiler supports it. These
> directories should use reasonably portable parts of C++03, so that it
> is
> possible to build GCC with C++ compilers other than GCC itself. If
> testing
> reveals that reasonably recent versions of non-GCC C++ compilers cannot
> compile GCC, then GCC code should be adjusted accordingly. (Avoiding
> unusual language constructs helps immensely.) Furthermore, these
> directories *should* also be compatible with C++11."

I think that page is out of date; as of GCC 11, we're allowing the use
of C++11 in gcc's implementation
  https://gcc.gnu.org/gcc-11/changes.html
though I think we're still being somewhat conservative, since we have
to be buildable with older compilers.

> 
> Does this requirement apply to libgccjit++.h as well? The header file
> is
> technically contained in the directory gcc. On the other hand, it is
> not
> used when building GCC.

Yeah - that particular file should probably fall under similar
compatibility rules to libstdc++ (though that said, I'm not as familiar
with libstdc++ as I probably should be).

> 
> I am asking because I have found the C++11 nullptr keyword in the
> header
> file.  

Good catch. 

> Can we generally lift the requirements to C++11 as far as the C++
> API for libgccjit is concerned?

Good idea.

> 
> As any user of libgccjit has access to a recent C++ compiler (because
> with
> libgccjit, there comes gcc), I would be very much in favor of lifting
> this
> requirement so that further developments of the API can use C++11
> features,
> including parameter packs generalizing all the ad-hoc overloadings of
> new_call in the current header.

Sounds good to me.

Dave



      reply	other threads:[~2022-01-31 14:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-31  9:39 Marc Nieper-Wißkirchen
2022-01-31 14:37 ` David Malcolm [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=63567678b4b477cab962c021e1970737521eab0d.camel@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=jit@gcc.gnu.org \
    --cc=marc.nieper+gnu@gmail.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).