Re: Coding in WalSndWaitForWal - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Coding in WalSndWaitForWal
Date
Msg-id 10254.1578599765@sss.pgh.pa.us
Whole thread Raw
In response to Re: Coding in WalSndWaitForWal  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: Coding in WalSndWaitForWal  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> In modern times, we define pg_attribute_noreturn() like this:

> /* GCC, Sunpro and XLC support aligned, packed and noreturn */
> #if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__IBMC__)
> #define pg_attribute_noreturn() __attribute__((noreturn))
> #define HAVE_PG_ATTRIBUTE_NORETURN 1
> #else
> #define pg_attribute_noreturn()
> #endif

> I suppose this will cause warnings in compilers other than those, but
> I'm not sure if we care.  What about MSVC for example?

Yeah, the lack of coverage for MSVC seems like the main reason not
to assume this works "everywhere of interest".

> With the attached patch, everything compiles cleanly in my setup, no
> warnings, but then it's GCC.

Meh ... I'm not really convinced that any of those changes are
improvements.  Particularly not the removals of switch-case breaks.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: our checks for read-only queries are not great
Next
From: Stephen Frost
Date:
Subject: Re: Removing pg_pltemplate and creating "trustable" extensions