Re: apply pragma system_header to python headers

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: apply pragma system_header to python headers
Дата
Msg-id 4072966.1699286789@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: apply pragma system_header to python headers  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: apply pragma system_header to python headers  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> On 2023-11-06 Mo 09:57, Tom Lane wrote:
>> +1 for the concept --- I was just noticing yesterday that my buildfarm
>> warning scraping script is turning up some of these.  However, we ought
>> to try to minimize the amount of our own code that is subject to the
>> pragma.  So I think a prerequisite ought to be to get this out of
>> plpython.h:
>> 
>> /*
>> * Used throughout, so it's easier to just include it everywhere.
>> */
>> #include "plpy_util.h"
>> 
>> Alternatively, is there a way to reverse the effect of the
>> pragma after we've included what we need?

> There's "GCC diagnostic push" and "GCC diagnostic pop" but I don't know 
> if they apply to "GCC system_header". Instead of using "GCC 
> system_header" we could just ignore the warnings we're seeing. e.g. "GCC 
> diagnostic ignored \"-Wdeclaration-after-statement\""

Probably a better way is to invent a separate header "plpython_system.h"
that just includes the Python headers, to scope the pragma precisely.
(I guess it could have the fixup #defines we're wrapping those headers
in, too.)

The same idea would work in plperl.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Moving forward with TDE [PATCH v3]
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Moving forward with TDE [PATCH v3]