Re: pgsql: Provide overflow safe integer math inline functions. - Mailing list pgsql-committers

From Michael Paquier
Subject Re: pgsql: Provide overflow safe integer math inline functions.
Date
Msg-id CAB7nPqS-T=GgEHX6aEAk_2X5B9uAUJgDOxHU5u1PkQfV1iuLjA@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Provide overflow safe integer math inline functions.  (Andres Freund <andres@anarazel.de>)
Responses Re: pgsql: Provide overflow safe integer math inline functions.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
On Sun, Dec 17, 2017 at 9:32 AM, Andres Freund <andres@anarazel.de> wrote:
> I've since tried this via the buildfarm, but still:
>
> configure:14480: checking for __builtin_mul_overflow
> configure:14500: ccache clang -o conftest -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
-Wendif-labels-Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv
-Wno-unused-command-line-argument-g -O2  -D_GNU_SOURCE  -I/usr/include/et   conftest.c -lssl -lcrypto -lz -lreadline
-lrt-lcrypt -ldl -lm  >&5 
> configure:14500: $? = 0
> configure:14508: result: yes
>
> I'm not quite following. Could you check if the same happens without
> -O2? Not because that'd be a solution, but to narrow down how this
> happens?

I have triggered a new test manually this morning on dangomushi
because I knew that it would fail as I have tested as well stuff
similar to the version you have pushed. Please note that if you added
a volatile cast to "result" as well, then compilation was able to
complete and regression tests passed...
--
Michael


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Suppress compiler warning about no function return value.
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Provide overflow safe integer math inline functions.