diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2018-08-31 12:26:20 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2018-08-31 12:27:07 -0400 |
commit | 853af991e35a0355bbb3ac9e941ac044beb89a0e (patch) | |
tree | 30ded0d39f883b8e02589a3cdafb3996daf69947 /src/backend/utils/adt/json.c | |
parent | 32f2792eb6163ce7265b22dad4a20ddd1b81c5eb (diff) | |
download | postgresql-853af991e35a0355bbb3ac9e941ac044beb89a0e.tar.gz postgresql-853af991e35a0355bbb3ac9e941ac044beb89a0e.zip |
Make checksum_impl.h safe to compile with -fstrict-aliasing.
In general, Postgres requires -fno-strict-aliasing with compilers that
implement C99 strict aliasing rules. There's little hope of getting
rid of that overall. But it seems like it would be a good idea if
storage/checksum_impl.h in particular didn't depend on it, because
that header is explicitly intended to be included by external programs.
We don't have a lot of control over the compiler switches that an
external program might use, as shown by Michael Banck's report of
failure in a privately-modified version of pg_verify_checksums.
Hence, switch to using a union in place of willy-nilly pointer casting
inside this file. I think this makes the code a bit more readable
anyway.
checksum_impl.h hasn't changed since it was introduced in 9.3,
so back-patch all the way.
Discussion: https://postgr.es/m/1535618100.1286.3.camel@credativ.de
Diffstat (limited to 'src/backend/utils/adt/json.c')
0 files changed, 0 insertions, 0 deletions