Re: Fix for configure error in 9.5/9.6 on macOS 11.0 Big Sur

Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>, Jesse Zhang <sbjesse@gmail.com>
Cc: Thomas Gilligan <thomas.gilligan@icloud.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-09-04T05:46:52Z
Lists: pgsql-hackers
On 2020-09-03 19:36, Tom Lane wrote:
> At least, that's what I got when I reinstalled Xcode just now on
> my Catalina machine.  It does not exhibit this behavior.  I see
> 
> $ clang -c c.c
> c.c:1:14: warning: implicitly declaring library function 'exit' with type 'void
>        (int) __attribute__((noreturn))' [-Wimplicit-function-declaration]
> int main() { exit(0); }
>               ^
> c.c:1:14: note: include the header <stdlib.h> or explicitly provide a
>        declaration for 'exit'
> 1 warning generated.
> 
> and PG configure and build goes through just fine.
> 
> Smells like an Apple bug from here.  Surely they're not expecting
> that anyone will appreciate -Werror suddenly being the default.

IIRC, calling an undeclared function is (or may be?) an error in C99. 
So perhaps the implicit -Werror only applies to this particular warning 
class.

I suppose backpatching the patch that fixed this would be appropriate.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Commits

  1. Use return instead of exit() in configure