Example: bounds3.c

up: index
prev: bounds2a.c
next: bounds4.c

    #include <stdio.h>
    #include "capprint.h"
    
    struct foo
    {
        char a[1000];
        int b;
    };
    
    int main()
    {
        struct foo x;
        fprintf(stderr,"&foo: %" PTR_FMT "\n", sptr((void*)(&x)));
        fprintf(stderr,"&foo.a: %" PTR_FMT "\n", sptr((void*)(&x.a)));
        fprintf(stderr,"&foo.n: %" PTR_FMT "\n", sptr((void*)(&x.b)));
    }
    
    

Experimental data (what does this mean?)

cerberus-cheri-no-pnvi
cerberus-cheri-revocation-no-pnvi
cerberus-cheri-cornucopia-no-pnvi
 &foo: (@disabled, 0xffffe328 [rwRW,0xffffe328-0xffffe714])
&foo.a: (@disabled, 0xffffe328 [rwRW,0xffffe328-0xffffe714])
&foo.n: (@disabled, 0xffffe710 [rwRW,0xffffe328-0xffffe714])
 
cerberus-cheri
cerberus-cheri-revocation
cerberus-cheri-cornucopia
 &foo: (@82, 0xffffe328 [rwRW,0xffffe328-0xffffe714])
&foo.a: (@82, 0xffffe328 [rwRW,0xffffe328-0xffffe714])
&foo.n: (@82, 0xffffe710 [rwRW,0xffffe328-0xffffe714])
 
clang-riscv-O3-bounds-subobject-safe &foo: 0x3fffdffb50 [rwRW,0x3fffdffb50-0x3fffdfff3c]
&foo.a: 0x3fffdffb50 [rwRW,0x3fffdffb50-0x3fffdfff38]
&foo.n: 0x3fffdfff38 [rwRW,0x3fffdfff38-0x3fffdfff3c]
 
clang-riscv-O0-bounds-subobject-safe
clang-riscv-O0-bounds-aggressive
clang-riscv-O0-bounds-very-aggressive
clang-riscv-O0-bounds-everywhere-unsafe
 &foo: 0x3fffdffb70 [rwRW,0x3fffdffb70-0x3fffdfff5c]
&foo.a: 0x3fffdffb70 [rwRW,0x3fffdffb70-0x3fffdfff58]
&foo.n: 0x3fffdfff58 [rwRW,0x3fffdfff58-0x3fffdfff5c]
 
clang-riscv-O3-bounds-conservative &foo: 0x3fffdffb40 [rwRW,0x3fffdffb40-0x3fffdfff2c]
&foo.a: 0x3fffdffb40 [rwRW,0x3fffdffb40-0x3fffdfff2c]
&foo.n: 0x3fffdfff28 [rwRW,0x3fffdffb40-0x3fffdfff2c]
 
clang-riscv-O0-bounds-conservative
clang-riscv-O0-bounds-references-only
 &foo: 0x3fffdffb70 [rwRW,0x3fffdffb70-0x3fffdfff5c]
&foo.a: 0x3fffdffb70 [rwRW,0x3fffdffb70-0x3fffdfff5c]
&foo.n: 0x3fffdfff58 [rwRW,0x3fffdffb70-0x3fffdfff5c]
 
clang-morello-O3-bounds-subobject-safe &foo: 0xfffffff7fb10 [rwRW,0xfffffff7fb10-0xfffffff7fefc]
&foo.a: 0xfffffff7fb10 [rwRW,0xfffffff7fb10-0xfffffff7fef8]
&foo.n: 0xfffffff7fef8 [rwRW,0xfffffff7fef8-0xfffffff7fefc]
 
clang-morello-O0-bounds-subobject-safe
clang-morello-O0-bounds-aggressive
clang-morello-O0-bounds-very-aggressive
clang-morello-O0-bounds-everywhere-unsafe
 &foo: 0xfffffff7fb60 [rwRW,0xfffffff7fb60-0xfffffff7ff4c]
&foo.a: 0xfffffff7fb60 [rwRW,0xfffffff7fb60-0xfffffff7ff48]
&foo.n: 0xfffffff7ff48 [rwRW,0xfffffff7ff48-0xfffffff7ff4c]
 
clang-morello-O3-bounds-conservative &foo: 0xfffffff7fb20 [rwRW,0xfffffff7fb20-0xfffffff7ff0c]
&foo.a: 0xfffffff7fb20 [rwRW,0xfffffff7fb20-0xfffffff7ff0c]
&foo.n: 0xfffffff7ff08 [rwRW,0xfffffff7fb20-0xfffffff7ff0c]
 
clang-morello-O0-bounds-conservative
clang-morello-O0-bounds-references-only
 &foo: 0xfffffff7fb60 [rwRW,0xfffffff7fb60-0xfffffff7ff4c]
&foo.a: 0xfffffff7fb60 [rwRW,0xfffffff7fb60-0xfffffff7ff4c]
&foo.n: 0xfffffff7ff48 [rwRW,0xfffffff7fb60-0xfffffff7ff4c]
 
gcc-morello-O0
gcc-morello-O3
 &foo: 0x7ffffbf0 [rwRW,0x7ffffbf0-0x7fffffdc]
&foo.a: 0x7ffffbf0 [rwRW,0x7ffffbf0-0x7fffffdc]
&foo.n: 0x7fffffd8 [rwRW,0x7ffffbf0-0x7fffffdc]