Re: RV: Compilation warning on 9.5

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Vicky Vergara <vicky_vergara(at)hotmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: RV: Compilation warning on 9.5
Date: 2016-11-08 22:30:22
Message-ID: CA+TgmoZGG5GYhANPoUXe+nbjHmT8DvmY3evKAvwWD_CeNaPwew@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 7, 2016 at 2:34 PM, Vicky Vergara <vicky_vergara(at)hotmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-11-08 22:33:48 Re: Do we need use more meaningful variables to replace 0 in catalog head files?
Previous Message Robert Haas 2016-11-08 22:28:51 Re: pgbench - allow backslash continuations in \set expressions