Re: Convert varatt.h macros to static inline functions - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: Convert varatt.h macros to static inline functions
Date
Msg-id CAD21AoAU1w8E1JyO=kHYsVm+KwGC5EAXdc7vGvmkryJ9Fy4jAA@mail.gmail.com
Whole thread Raw
In response to Re: Convert varatt.h macros to static inline functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Convert varatt.h macros to static inline functions
List pgsql-hackers
On Tue, Aug 5, 2025 at 11:34 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Masahiko Sawada <sawada.mshk@gmail.com> 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);
> >       |                             ^~~~~~~~~~~~~~~~~~~~~
>
> > I've not fully investigated the root cause but commit e035863c9a0
> > presumably is the culprit. FYI I'm using gcc 14.2.1.
>
> 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 something is strange on my end:

% gcc --version
gcc (GCC) 14.3.1 20250805

> Theoretically this shouldn't be necessary, since VARDATA()
> does not touch the contents of the pointed-to object.

Right. I'll do more research.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bug in brin_minmax_multi_distance_numeric()
Next
From: Tomas Vondra
Date:
Subject: Re: index prefetching