| 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:33:39 |
| Message-ID: | CAM-w4HN1W_C0ummS1bOZtSiqEOLeLDyEbbtj_nzbarYHiDXC=g@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers pgsql-hackers |
Ah. Here we go:
$ /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:54:9: error: use of undeclared identifier 'BlockNumber'
return ItemPointerGetBlockNumber(&ip);
^
clang-bug.c:48:2: note: expanded from macro 'ItemPointerGetBlockNumber'
BlockIdGetBlockNumber(&(pointer)->ip_blkid) \
^
clang-bug.c:38:3: note: expanded from macro 'BlockIdGetBlockNumber'
(BlockNumber) (((blockId)->bi_hi << 16) | ((uint16) (blockId)->bi_lo)) \
^
1 error generated.
Preprocessor output:
# 1 "clang-bug.c"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 317 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "clang-bug.c" 2
typedef unsigned short uint16;
typedef uint16 OffsetNumber;
typedef struct BlockIdData
{
uint16 bi_hi;
uint16 bi_lo;
} BlockIdData;
typedef struct ItemPointerData
{
BlockIdData ip_blkid;
OffsetNumber ip_posid;
}
__attribute__((packed))
__attribute__((aligned(2)))
ItemPointerData;
typedef ItemPointerData *ItemPointer;
# 51 "clang-bug.c"
int main() {
ItemPointerData ip;
return ( ( (BlockNumber) (((&(&ip)->ip_blkid)->bi_hi << 16) |
((uint16) (&(&ip)->ip_blkid)->bi_lo)) ) );
}
| Attachment | Content-Type | Size |
|---|---|---|
| clang-bug.c | text/x-csrc | 1.1 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Greg Stark | 2016-10-19 16:36:07 | Re: [COMMITTERS] packing/alignment annotation for ItemPointerData redux |
| Previous Message | Greg Stark | 2016-10-19 16:30:03 | Re: [COMMITTERS] packing/alignment annotation for ItemPointerData redux |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andreas Joseph Krogh | 2016-10-19 16:33:55 | Re: Move pg_largeobject to a different tablespace *without* turning on system_table_mods. |
| Previous Message | Greg Stark | 2016-10-19 16:30:03 | Re: [COMMITTERS] packing/alignment annotation for ItemPointerData redux |