Re: [COMMITTERS] packing/alignment annotation for ItemPointerData redux

From: Greg Stark <stark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] packing/alignment annotation for ItemPointerData redux
Date: 2016-10-19 16:36:07
Message-ID: CAM-w4HOrs7mxkyrhhAPoCBSypE=C1xi+ecf7RaHzah3N9HLfhQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Sorry -- with the obvious error fixed:

$ /usr/bin/clang-4.0 -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels
-Wmissing-format-attribute -Wformat-security -fno-strict-aliasing
-fwrapv -Wno-unused-command-line-argument -Wall -c clang-bug.c
clang-bug.c:55:9: warning: taking address of packed member 'ip_blkid'
of class or structure
'ItemPointerData' may result in an unaligned pointer value
[-Waddress-of-packed-member]
return ItemPointerGetBlockNumber(&ip);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clang-bug.c:49:25: note: expanded from macro 'ItemPointerGetBlockNumber'
BlockIdGetBlockNumber(&(pointer)->ip_blkid) \
~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
clang-bug.c:39:19: note: expanded from macro 'BlockIdGetBlockNumber'
(BlockNumber) (((blockId)->bi_hi << 16) | ((uint16) (blockId)->bi_lo)) \
^~~~~~~
clang-bug.c:55:9: warning: taking address of packed member 'ip_blkid'
of class or structure
'ItemPointerData' may result in an unaligned pointer value
[-Waddress-of-packed-member]
return ItemPointerGetBlockNumber(&ip);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clang-bug.c:49:25: note: expanded from macro 'ItemPointerGetBlockNumber'
BlockIdGetBlockNumber(&(pointer)->ip_blkid) \
~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
clang-bug.c:39:55: note: expanded from macro 'BlockIdGetBlockNumber'
(BlockNumber) (((blockId)->bi_hi << 16) | ((uint16) (blockId)->bi_lo)) \
^~~~~~~
2 warnings generated.

Attachment Content-Type Size
clang-bug.c text/x-csrc 1.1 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-10-19 16:51:35 Re: [COMMITTERS] packing/alignment annotation for ItemPointerData redux
Previous Message Greg Stark 2016-10-19 16:33:39 Re: [COMMITTERS] packing/alignment annotation for ItemPointerData redux

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2016-10-19 16:40:43 Re: Indirect indexes
Previous Message Andreas Joseph Krogh 2016-10-19 16:33:55 Re: Move pg_largeobject to a different tablespace *without* turning on system_table_mods.