Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Masahiko Sawada
On Tue, Aug 5, 2025 at 3:07 PM Masahiko Sawada wrote: > > On Tue, Aug 5, 2025 at 2:39 PM Tom Lane wrote: > > > > Masahiko Sawada writes: > > > On Tue, Aug 5, 2025 at 1:59 PM Tom Lane wrote: > > >> Maybe there's some strange cross-distro difference here, but > > >> what I'm wondering is if there

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Masahiko Sawada
On Tue, Aug 5, 2025 at 2:39 PM Tom Lane wrote: > > Masahiko Sawada writes: > > On Tue, Aug 5, 2025 at 1:59 PM Tom Lane wrote: > >> Maybe there's some strange cross-distro difference here, but > >> what I'm wondering is if there's a difference in CFLAGS. > >> My build used > >> > >> CFLAGS = -Wal

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Tom Lane
Masahiko Sawada writes: > On Tue, Aug 5, 2025 at 1:59 PM Tom Lane wrote: >> Maybe there's some strange cross-distro difference here, but >> what I'm wondering is if there's a difference in CFLAGS. >> My build used >> >> CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith >> -Wdeclaration-after-

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Masahiko Sawada
On Tue, Aug 5, 2025 at 1:59 PM Tom Lane wrote: > > Masahiko Sawada writes: > > On Tue, Aug 5, 2025 at 11:34 AM Tom Lane wrote: > >> Interesting. I did not see such warnings with gcc 14.3.1, 15.1.1, > >> nor older gcc versions. Must be something peculiar to 14.2. > > > Hmm, I got the same warni

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Tom Lane
Masahiko Sawada writes: > On Tue, Aug 5, 2025 at 11:34 AM Tom Lane wrote: >> Interesting. I did not see such warnings with gcc 14.3.1, 15.1.1, >> nor older gcc versions. Must be something peculiar to 14.2. > Hmm, I got the same warning with 14.3.1 (exact version shown below) so > probably some

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Masahiko Sawada
On Tue, Aug 5, 2025 at 11:34 AM Tom Lane wrote: > > Masahiko Sawada writes: > > I got the following compiler warning: > > > % make -C src/backend/storage/large_object > > inv_api.c: In function ‘inv_write’: > > inv_api.c:565:29: warning: ‘workbuf’ may be used uninitialized > > [-Wmaybe-uninitial

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Tom Lane
Masahiko Sawada writes: > I got the following compiler warning: > % make -C src/backend/storage/large_object > inv_api.c: In function ‘inv_write’: > inv_api.c:565:29: warning: ‘workbuf’ may be used uninitialized > [-Wmaybe-uninitialized] > 565 | char *workb = VARDATA(&workbuf.hdr

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Masahiko Sawada
Hi, On Tue, Aug 5, 2025 at 9:42 AM Peter Eisentraut wrote: > > On 03.08.25 22:20, Tom Lane wrote: > > It looks like the majority vote is still in favor of writing out > > DatumGetPointer instead of using "_D()" functions, so let's roll > > with that approach. > > > > I looked through our two vers

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Tom Lane
Peter Eisentraut writes: > I committed this with the required prerequisite patches. That concludes > this thread, I think. I'll follow up on the remaining work in the > "Datum as struct" thread, and the work in the "8 byte Datums" thread can > also continue. Thanks! The "8 byte Datums" work

Re: Convert varatt.h macros to static inline functions

2025-08-05 Thread Peter Eisentraut
On 03.08.25 22:20, Tom Lane wrote: It looks like the majority vote is still in favor of writing out DatumGetPointer instead of using "_D()" functions, so let's roll with that approach. I looked through our two versions of the varatt.h changes and merged them. The attached is only cosmetically d

Re: Convert varatt.h macros to static inline functions

2025-08-03 Thread Tom Lane
It looks like the majority vote is still in favor of writing out DatumGetPointer instead of using "_D()" functions, so let's roll with that approach. I looked through our two versions of the varatt.h changes and merged them. The attached is only cosmetically different from yours, I think --- most

Re: Convert varatt.h macros to static inline functions

2025-07-31 Thread Tom Lane
Michael Paquier writes: > Another comment that can apply to all the patches presented on this > thread. Could it be worth splitting these inline functions into a > separate header that declares varatt.h, meaning that we'd need to > think a bit more about the structures themselves and all the > su

Re: Convert varatt.h macros to static inline functions

2025-07-31 Thread Michael Paquier
On Thu, Jul 31, 2025 at 10:06:02AM -0400, Tom Lane wrote: > Peter Eisentraut writes: > > I had this lying around as a draft patch, as part of my ongoing campaign > > to convert many complicated macros to static inline functions. Since > > the topic was mentioned in another thread [0], I cleaned

Re: Convert varatt.h macros to static inline functions

2025-07-31 Thread Greg Burd
> On Jul 31, 2025, at 10:06 AM, Tom Lane wrote: > > Peter Eisentraut writes: >> I had this lying around as a draft patch, as part of my ongoing campaign  >> to convert many complicated macros to static inline functions.  Since  >> the topic was mentioned in another thread [0], I cleaned up the

Re: Convert varatt.h macros to static inline functions

2025-07-31 Thread Tom Lane
Peter Eisentraut writes: > I had this lying around as a draft patch, as part of my ongoing campaign > to convert many complicated macros to static inline functions. Since > the topic was mentioned in another thread [0], I cleaned up the patch so > that we can all look at it. I had just finish