Re: RV: Compilation warning on 9.5 - Mailing list pgsql-hackers

From Robert Haas
Subject Re: RV: Compilation warning on 9.5
Date
Msg-id CA+TgmoZGG5GYhANPoUXe+nbjHmT8DvmY3evKAvwWD_CeNaPwew@mail.gmail.com
Whole thread Raw
In response to RV: Compilation warning on 9.5  (Vicky Vergara <vicky_vergara@hotmail.com>)
List pgsql-hackers
On Mon, Nov 7, 2016 at 2:34 PM, Vicky Vergara <vicky_vergara@hotmail.com> wrote:
Hello,

Posting an update to this issue (which by the way also shows up on 9.6)

Maybe this information is useful for extension developers (that have all the warnings flags on while developing using GNUC)


By wrapping the files as follows, any warnings generated by the postgres's header files are ignored.


#ifdef __GNUC__
#pragma GCC diagnostic ignored "-pedantic"
#endif

#include "postgres.h"

#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif


#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif

#include "executor/spi.h"

#ifdef __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif

#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif

#include "funcapi.h"

#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif

Wow, that's pretty ugly.  But it's useful to know that it is available in a pinch.  Thanks!
 
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Do we need use more meaningful variables to replace 0 in catalog head files?
Next
From: Robert Haas
Date:
Subject: Re: pgbench - allow backslash continuations in \set expressions