Re: backup manifests - Mailing list pgsql-hackers

From Andres Freund
Subject Re: backup manifests
Date
Msg-id 20200423211629.payzm7rr6gkubpa4@alap3.anarazel.de
Whole thread Raw
In response to Re: backup manifests  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: backup manifests
List pgsql-hackers
Hi,

On 2020-04-23 08:57:39 -0400, Robert Haas wrote:
> On Sun, Apr 5, 2020 at 3:31 PM Andres Freund <andres@anarazel.de> wrote:
> > The warnings don't seem too unreasonable. The compiler can't see that
> > the error_cb inside json_manifest_parse_failure() is not expected to
> > return. Probably worth adding a wrapper around the calls to
> > context->error_cb and mark that as noreturn.
> 
> Eh, how? The callback is declared as:
> 
> typedef void (*json_manifest_error_callback)(JsonManifestParseContext *,
>                                                                  char
> *fmt, ...) pg_attribute_printf(2, 3);
> 
> I don't know of a way to create a wrapper around that, because of the
> variable argument list.

Didn't think that far...


> We could change the callback to take va_list, I guess.

I'd argue that that'd be a good idea anyway, otherwise there's no way to
wrap the invocation anywhere in the code. But that's an independent
consideration, as:

> Does it work for you to just add pg_attribute_noreturn() to this
> typedef, as in the attached?

does fix the problem for me, cool.

Do you not see a warning when compiling with optimizations enabled?

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: James Coleman
Date:
Subject: Re: [PATCH] Fix division by zero (explain.c)
Next
From: David Rowley
Date:
Subject: Re: Binary search in ScalarArrayOpExpr for OR'd constant arrays