Re: [COMMITTERS] packing/alignment annotation for ItemPointerData redux - Mailing list pgsql-hackers

From Greg Stark
Subject Re: [COMMITTERS] packing/alignment annotation for ItemPointerData redux
Date
Msg-id CAM-w4HOrs7mxkyrhhAPoCBSypE=C1xi+ecf7RaHzah3N9HLfhQ@mail.gmail.com
Whole thread Raw
In response to Re: [COMMITTERS] packing/alignment annotation for ItemPointerData redux  (Greg Stark <stark@mit.edu>)
Responses Re: [COMMITTERS] packing/alignment annotation for ItemPointerData redux  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: [COMMITTERS] packing/alignment annotation for ItemPointerData redux
Next
From: Bruce Momjian
Date:
Subject: Re: Indirect indexes