checkedc icon indicating copy to clipboard operation
checkedc copied to clipboard

Document itypes on typedef struct S* HANDLE to reduce confusion

Open AnnaKornfeldSimpson opened this issue 7 years ago • 0 comments

The result of putting a bounds-safe interface on the following code:

typedef struct foo
{ //...
    HANDLE h; // HANDLE is defined as typedef struct S* HANDLE
//...
}

is a little bit unintuitive and less readable than most interface additions:

typedef struct foo
{ //...
    HANDLE h : itype(ptr<struct S>);
//...
}

We should add an example of this to the documentation on bounds-safe interfaces, since typedef struct FOO* BAR is a very common C idiom.

AnnaKornfeldSimpson avatar Aug 22 '18 21:08 AnnaKornfeldSimpson