CURL_IGNORE_DEPRECATION - Mailing list pgsql-hackers

From Álvaro Herrera
Subject CURL_IGNORE_DEPRECATION
Date
Msg-id 202511111134.njrwf5w5nbjm@alvherre.pgsql
Whole thread Raw
Responses Re: CURL_IGNORE_DEPRECATION
Re: CURL_IGNORE_DEPRECATION
List pgsql-hackers
Hackers,

I just noticed that we have some ad-hoc hacks for the
CURL_IGNORE_DEPRECATION macro in the pgindent Perl script, which I find
a bit uncomfortable.  Given that we use that macro in a single place,
what do you think about removing that and making a more surgical
intervention to fix pgindent problem with it?  I propose the attached.

For context: in curl, that macro is defined like this

#define CURL_IGNORE_DEPRECATION(statements) \
      _Pragma("GCC diagnostic push") \
      _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
      statements \
      _Pragma("GCC diagnostic pop")

(with #ifdef guards and whatnot).  Because it has a _Pragma after the
statements argument, any uses of this macro must have a terminating
semicolon, which pgindent does not like.  (It's also IMO rather
C-unlike).  So my approach here is to add another macro to insert that
semicolon where it's needed.  Of course, there's nothing we can do with
CURL_IGNORE_DEPRECATION() itself, given that it's upstream from us.

Thoughts?

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
“Cuando no hay humildad las personas se degradan” (A. Christie)

Attachment

pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: [PATCH] Add pg_get_subscription_ddl() function
Next
From: Tomas Vondra
Date:
Subject: Re: Adding basic NUMA awareness