public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
* Portability requirements of libgccjit++.h
@ 2022-01-31  9:39 Marc Nieper-Wißkirchen
  2022-01-31 14:37 ` David Malcolm
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Nieper-Wißkirchen @ 2022-01-31  9:39 UTC (permalink / raw)
  To: Marc Nieper-Wißkirchen via Jit

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."

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.

I am asking because I have found the C++11 nullptr keyword in the header
file.  Can we generally lift the requirements to C++11 as far as the C++
API for libgccjit is concerned?

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.

Thanks,

Marc

--

[1] - https://gcc.gnu.org/codingconventions.html#Cxx_Language

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Portability requirements of libgccjit++.h
  2022-01-31  9:39 Portability requirements of libgccjit++.h Marc Nieper-Wißkirchen
@ 2022-01-31 14:37 ` David Malcolm
  0 siblings, 0 replies; 2+ messages in thread
From: David Malcolm @ 2022-01-31 14:37 UTC (permalink / raw)
  To: Marc Nieper-Wißkirchen, Marc Nieper-Wißkirchen via Jit

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-31 14:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-31  9:39 Portability requirements of libgccjit++.h Marc Nieper-Wißkirchen
2022-01-31 14:37 ` David Malcolm

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).