type_t *const points_to = skip_typeref(pointer_type->points_to);
unsigned elem_size = get_type_size_const(points_to);
- /* gcc extension */
- if (elem_size == 0 && is_type_atomic(points_to, ATOMIC_TYPE_VOID)) {
+ /* gcc extension: allow arithmetic with void * and function * */
+ if (elem_size == 0 &&
+ (is_type_atomic(points_to, ATOMIC_TYPE_VOID) ||
+ is_type_function(points_to))) {
elem_size = 1;
}