Re: Compilation warning on 9.5

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vicky Vergara <vicky_vergara(at)hotmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Compilation warning on 9.5
Date: 2016-02-12 19:45:23
Message-ID: 5543.1455306323@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Vicky Vergara <vicky_vergara(at)hotmail(dot)com> writes:
> I wonder if -std=gnu99 is the correct standard to include postgres.h etc. in 9.5
> because that standard (and all the flags I am using to generate pgrouting code without warnings)
> catches the following catches warnings of type conversions on some postgresql included files.

It's not -std=gnu99 that's causing those messages, it's -pedantic and
-Wconversion respectively.

> /usr/include/postgresql/9.5/server/c.h:298:9: warning: ISO C does not support __int128 type [-pedantic]
> /usr/include/postgresql/9.5/server/c.h:299:18: warning: ISO C does not support __int128 type [-pedantic]

We're not going to do anything about this one; certainly we won't stop
using int128 where it's available, and there isn't any other apparent way
to suppress the warning. I doubt that -pedantic is a useful switch in
practice, and this seems to be a particularly unhelpful bit of pedantry.
Consider dropping that flag.

> /usr/include/postgresql/9.5/server/port/atomics/generic.h: In function pg_atomic_add_fetch_u32_impl:
> /usr/include/postgresql/9.5/server/port/atomics/generic.h:238:2: warning: conversion to uint32 from int32 may change the sign of the result [-Wsign-conversion]

According to the gcc manual, inserting explicit casts would silence these;
is that worth doing? I doubt anyone cares about making all our code
-Wconversion clean, but maybe making the headers clean would be worth
the trouble.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2016-02-12 20:11:39 Re: proposal: schema PL session variables
Previous Message Vicky Vergara 2016-02-12 18:53:11 Compilation warning on 9.5