Is it conforming or not. Object size calculatiuon using pointers of different types than the original object

Viewed 86

Inspired by: Object size from (begin, end) pointers in strictly conforming C

Is this function conforming or not?

//end always past start
size_t objsize(const void *restrict start, const void *restrict end)
{
    const unsigned long long * restrict s = start;
    const unsigned long long * restrict e = end;

    return sizeof(*s) * (size_t)(e - s);
}
0 Answers
Related