- if (is_type_incomplete(points_to) &&
- !((c_mode & _GNUC)
- && is_type_atomic(points_to, ATOMIC_TYPE_VOID))) {
- errorf(source_position,
- "arithmetic with pointer to incomplete type '%T' not allowed",
- orig_pointer_type);
- return false;
- } else if (!(c_mode & _GNUC) && is_type_function(points_to)) {
- errorf(source_position,
- "arithmetic with pointer to function type '%T' not allowed",
- orig_pointer_type);
- return false;
- }
- if (warning.pointer_arith) {
- if (is_type_atomic(points_to, ATOMIC_TYPE_VOID)) {
+ if (is_type_incomplete(points_to)) {
+ if (!(c_mode & _GNUC) || !is_type_atomic(points_to, ATOMIC_TYPE_VOID)) {
+ errorf(source_position,
+ "arithmetic with pointer to incomplete type '%T' not allowed",
+ orig_pointer_type);
+ return false;
+ } else if (warning.pointer_arith) {