Question

sizeof(void*) and sizeof(function_type_ptr*) equality

Must sizeof(void*) and sizeof(function_type_ptr*) be equal? Is it required by C (C90, C99) standard?

function_type_ptr is pointer to function.

This question is about standard requirements, not your own opinion. Please, give links, section numbers and quotations from standards

Was it helpful?

Solution

The answer is no.

6.2.6.1/2: Except for bit-fields, objects are composed of contiguous sequences of one or more bytes, the number, order, and encoding of which are either explicitly specified or implementation-defined.

No such specification is done for function / void pointers.

OTHER TIPS

According to this post the answer is no, there is no guarantee that even sizeof(int*) is the same as sizeof(double*).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top