Re: GCC support for extensions from later standards

2023-08-08 Thread Jakub Jelinek via Gcc
On Mon, Aug 07, 2023 at 08:03:05PM -0700, Nikolas Klauser wrote: > Thanks for the answers! > > There are a few really interesting extensions that I would like to use: > > - inline variables > - variable templates > - `if constexpr` > - fold expressions > - conditional explicit > - static operator

Re: GCC support for extensions from later standards

2023-08-08 Thread Jonathan Wakely via Gcc
On Mon, 7 Aug 2023 at 14:04, Jonathan Wakely wrote: > > On Sun, 6 Aug 2023 at 20:43, Jonathan Wakely wrote: > > > > On Sun, 6 Aug 2023 at 20:20, Jason Merrill via Libstdc++ > > wrote: > > > > > > On Wed, Aug 2, 2023 at 12:02 PM Nikolas Klauser > > > wrote: > > > > > > > Hi everyone! > > > > > >

What should be the type of 9223372036854775808L ? unsigned long or signed __int128?

2023-08-08 Thread Helmut Zeisel via Gcc
GCC13, c++, cygwin 64: auto x = 9223372036854775808L gives the warning: "integer constant is so large that it is unsigned" But actually the type is signed __int128: std::cout << x; gives the error: "ambiguous overload for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostre

Re: _Nullable and _Nonnull in GCC's analyzer (was: [PATCH v5] libio: Add nonnull attribute for most FILE * arguments in stdio.h)

2023-08-08 Thread Martin Uecker
Am Montag, dem 10.07.2023 um 22:16 +0200 schrieb Alejandro Colomar via Gcc: > On 7/10/23 22:14, Alejandro Colomar wrote: > > [CC += Andrew] > > > > Hi Xi, Andrew, > > > > On 7/10/23 20:41, Xi Ruoyao wrote: > > > Maybe we should have a weaker version of nonnull which only performs the > > > diagno

Re: What should be the type of 9223372036854775808L ? unsigned long or signed __int128?

2023-08-08 Thread Jonathan Wakely via Gcc
On Tue, 8 Aug 2023 at 10:09, Helmut Zeisel via Gcc wrote: > > GCC13, c++, cygwin 64: > > auto x = 9223372036854775808L > > gives the warning: "integer constant is so large that it is unsigned" > > But actually the type is signed __int128: > > std::cout << x; > > gives the error: "ambiguous overlo

Re: GCC support for extensions from later standards

2023-08-08 Thread Nikolas Klauser
Luckily most of these aren’t problems for libc++. We only support the latest GCC. We can only use `if constexpr` in C++11, but that is already a win I think. Nikolas > On Aug 8, 2023, at 12:33 AM, Jakub Jelinek wrote: > > On Mon, Aug 07, 2023 at 08:03:05PM -0700, Nikolas Klauser wrote: >> Than

Re: GCC support for extensions from later standards

2023-08-08 Thread Jonathan Wakely via Gcc
On Tue, 8 Aug 2023 at 17:04, Nikolas Klauser wrote: > > Luckily most of these aren’t problems for libc++. We only support the latest > GCC. We can only use `if constexpr` in C++11, but that is already a win I > think. Can you use it in C++11 though? The body of a constexpr function must be a sin

Re: GCC support for extensions from later standards

2023-08-08 Thread Jonathan Wakely via Gcc
On Tue, 8 Aug 2023 at 17:07, Jonathan Wakely wrote: > > On Tue, 8 Aug 2023 at 17:04, Nikolas Klauser wrote: > > > > Luckily most of these aren’t problems for libc++. We only support the > > latest GCC. We can only use `if constexpr` in C++11, but that is already a > > win I think. > > Can you use

Re: GCC support for extensions from later standards

2023-08-08 Thread Nikolas Klauser
Yes, Clang allows it. Most importantly though: you don’t have to be in a constexpr function for `if constexpr` to be useful. e.g. the Algorithms aren’t constexpr until C++20, but a lot of them have overloads for improving the algorithm based on the iterator category. Having `if constexpr` there

[PATCH] WIP for dg-require-python-h [PR107646]

2023-08-08 Thread Eric Feng via Gcc
Unfortunately, there doesn’t seem to be any ERRORs in the .log nor any of the debug print statements which I’ve scattered within proc dg-require-python-h when run. I’ve attached the WIP below; thank you! Please note that in this version of the patch, I’ve removed the other (non Python) test case

Re: [PATCH] WIP for dg-require-python-h [PR107646]

2023-08-08 Thread David Malcolm via Gcc
On Tue, 2023-08-08 at 12:51 -0400, Eric Feng wrote: > Unfortunately, there doesn’t seem to be any ERRORs in the .log nor > any of the debug print statements which I’ve scattered within proc > dg-require-python-h when run. I’ve attached the WIP below; thank you! > Please note that in this version of

Re: [PATCH] WIP for dg-require-python-h [PR107646]

2023-08-08 Thread David Malcolm via Gcc
On Tue, 2023-08-08 at 12:51 -0400, Eric Feng wrote: > Unfortunately, there doesn’t seem to be any ERRORs in the .log nor > any of the debug print statements which I’ve scattered within proc > dg-require-python-h when run. I’ve attached the WIP below; thank you! > Please note that in this version of

FW: Introducing the "wincall" Calling Convention for GCC

2023-08-08 Thread sotrdg sotrdg via Gcc
I present a novel calling convention named "wincall" designed specifically for GCC. This convention is accompanied by the [[__gnu__::__wincall__]] attribute and caters to the latest Intel APX instructions on Windows systems, excluding Linux, BSD, and similar platforms. Motivation: The current

Re: _Nullable and _Nonnull in GCC's analyzer (was: [PATCH v5] libio: Add nonnull attribute for most FILE * arguments in stdio.h)

2023-08-08 Thread enh via Gcc
(bionic maintainer here, mostly by accident...) yeah, we tried the GCC attributes once before with _disastrous_ results (because GCC saw it as an excuse to delete explicit null checks, it broke all kinds of things). the clang attributes are "better" in that they don't confuse two entirely separate

Re: _Nullable and _Nonnull in GCC's analyzer (was: [PATCH v5] libio: Add nonnull attribute for most FILE * arguments in stdio.h)

2023-08-08 Thread Siddhesh Poyarekar
On 2023-08-08 20:14, enh wrote: (bionic maintainer here, mostly by accident...) yeah, we tried the GCC attributes once before with _disastrous_ results (because GCC saw it as an excuse to delete explicit null checks, it broke all kinds of things). the clang attributes are AFAICT based on earli