Re: unconstify()/unvolatize() vs g++/clang++

2023-12-11 Thread Thomas Munro
On Mon, Dec 11, 2023 at 11:32 PM Thomas Munro wrote: > On Mon, Dec 11, 2023 at 10:17 PM Peter Eisentraut > wrote: > > If you are slightly more daring, you can write an alternative definition > > in C++ using const_cast? > > Oh, yeah, right, that works for my case. I can't think of any > reason

Re: unconstify()/unvolatize() vs g++/clang++

2023-12-11 Thread Thomas Munro
On Mon, Dec 11, 2023 at 10:17 PM Peter Eisentraut wrote: > If you are slightly more daring, you can write an alternative definition > in C++ using const_cast? Oh, yeah, right, that works for my case. I can't think of any reasons not to do this, but IANAC++L. 0001-Define-unconstify-and-unvolat

Re: unconstify()/unvolatize() vs g++/clang++

2023-12-11 Thread Peter Eisentraut
On 11.12.23 01:42, Thomas Munro wrote: AFAICS you can't use unconstify()/unvolatize() in a static inline function in a .h file, or in a .cpp file, because __builtin_types_compatible_p is only available in C, not C++. Seems like a reasonable thing to want to be able to do, no? I'm not immediatel

unconstify()/unvolatize() vs g++/clang++

2023-12-10 Thread Thomas Munro
Hi, AFAICS you can't use unconstify()/unvolatize() in a static inline function in a .h file, or in a .cpp file, because __builtin_types_compatible_p is only available in C, not C++. Seems like a reasonable thing to want to be able to do, no? I'm not immediately sure what the right fix is; would