apply pragma system_header to python headers

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-11-06T12:02:15Z
Lists: pgsql-hackers

Attachments

Analogous to 388e80132c (which was for Perl) but for Python, I propose 
adding #pragma GCC system_header to plpython.h.  Without it, you get 
tons of warnings about -Wdeclaration-after-statement, starting with 
Python 3.12.  (In the past, I have regularly sent feedback to Python to 
fix their header files, but this is getting old, and we have an easier 
solution now.)

Commits

  1. Hide warnings from Python headers when using gcc-compatible compiler.