extern void c_do_switch_warnings (splay_tree, location_t, tree, tree, bool);
extern void warn_for_omitted_condop (location_t, tree);
extern bool warn_for_restrict (unsigned, tree *, unsigned);
-extern void warn_for_address_or_pointer_of_packed_member (tree, tree);
+extern void warn_for_address_of_packed_member (tree, tree);
extern void warn_parm_array_mismatch (location_t, tree, tree);
extern void maybe_warn_sizeof_array_div (location_t, tree, tree, tree, tree);
extern void do_warn_array_compare (location_t, tree_code, tree, tree);
return NULL_TREE;
}
-/* Return struct or union type if the right hand value, RHS
+/* Return struct or union type if the right hand value, RHS,
is an address which takes the unaligned address of packed member
of struct or union when assigning to TYPE.
Otherwise, return NULL_TREE. */
static tree
-check_address_or_pointer_of_packed_member (tree type, tree rhs)
+check_address_of_packed_member (tree type, tree rhs)
{
bool rvalue = true;
bool indirect = false;
return context;
}
-/* Check and warn if the right hand value, RHS:
- 1. Is a pointer value which isn't aligned to a pointer type TYPE.
- 2. Is an address which takes the unaligned address of packed member
- of struct or union when assigning to TYPE.
- */
+/* Check and warn if the right hand value, RHS,
+ is an address which takes the unaligned address of packed member
+ of struct or union when assigning to TYPE. */
static void
-check_and_warn_address_or_pointer_of_packed_member (tree type, tree rhs)
+check_and_warn_address_of_packed_member (tree type, tree rhs)
{
bool nop_p = false;
tree orig_rhs;
if (TREE_CODE (rhs) == COND_EXPR)
{
/* Check the THEN path. */
- check_and_warn_address_or_pointer_of_packed_member
+ check_and_warn_address_of_packed_member
(type, TREE_OPERAND (rhs, 1));
/* Check the ELSE path. */
- check_and_warn_address_or_pointer_of_packed_member
+ check_and_warn_address_of_packed_member
(type, TREE_OPERAND (rhs, 2));
}
else
}
tree context
- = check_address_or_pointer_of_packed_member (type, rhs);
+ = check_address_of_packed_member (type, rhs);
if (context)
{
location_t loc = EXPR_LOC_OR_LOC (rhs, input_location);
}
}
-/* Warn if the right hand value, RHS:
- 1. Is a pointer value which isn't aligned to a pointer type TYPE.
- 2. Is an address which takes the unaligned address of packed member
- of struct or union when assigning to TYPE.
-*/
+/* Warn if the right hand value, RHS,
+ is an address which takes the unaligned address of packed member
+ of struct or union when assigning to TYPE. */
void
-warn_for_address_or_pointer_of_packed_member (tree type, tree rhs)
+warn_for_address_of_packed_member (tree type, tree rhs)
{
if (!warn_address_of_packed_member)
return;
if (!POINTER_TYPE_P (type))
return;
- check_and_warn_address_or_pointer_of_packed_member (type, rhs);
+ check_and_warn_address_of_packed_member (type, rhs);
}
/* Return EXPR + 1. Convenience helper used below. */
if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (rhstype))
{
- warn_for_address_or_pointer_of_packed_member (type, orig_rhs);
+ warn_for_address_of_packed_member (type, orig_rhs);
return rhs;
}
/* If RHS isn't an address, check pointer or array of packed
struct or union. */
- warn_for_address_or_pointer_of_packed_member (type, orig_rhs);
+ warn_for_address_of_packed_member (type, orig_rhs);
return convert (type, rhs);
}