aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-warn.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-family/c-warn.cc')
-rw-r--r--gcc/c-family/c-warn.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/gcc/c-family/c-warn.cc b/gcc/c-family/c-warn.cc
index 47e0a6b..05d6e37 100644
--- a/gcc/c-family/c-warn.cc
+++ b/gcc/c-family/c-warn.cc
@@ -944,8 +944,9 @@ sizeof_pointer_memaccess_warning (location_t *sizeof_arg_loc, tree callee,
"argument to %<sizeof%> in %qD call is the same "
"expression as the destination; did you mean to "
"remove the addressof?", callee);
- else if ((TYPE_PRECISION (TREE_TYPE (type))
- == TYPE_PRECISION (char_type_node))
+ else if ((INTEGRAL_TYPE_P (TREE_TYPE (type))
+ && (TYPE_PRECISION (TREE_TYPE (type))
+ == TYPE_PRECISION (char_type_node)))
|| strop)
warning_at (loc, OPT_Wsizeof_pointer_memaccess,
"argument to %<sizeof%> in %qD call is the same "
@@ -984,8 +985,9 @@ sizeof_pointer_memaccess_warning (location_t *sizeof_arg_loc, tree callee,
"argument to %<sizeof%> in %qD call is the same "
"expression as the source; did you mean to "
"remove the addressof?", callee);
- else if ((TYPE_PRECISION (TREE_TYPE (type))
- == TYPE_PRECISION (char_type_node))
+ else if ((INTEGRAL_TYPE_P (TREE_TYPE (type))
+ && (TYPE_PRECISION (TREE_TYPE (type))
+ == TYPE_PRECISION (char_type_node)))
|| strop)
warning_at (loc, OPT_Wsizeof_pointer_memaccess,
"argument to %<sizeof%> in %qD call is the same "
@@ -1024,8 +1026,9 @@ sizeof_pointer_memaccess_warning (location_t *sizeof_arg_loc, tree callee,
"argument to %<sizeof%> in %qD call is the same "
"expression as the first source; did you mean to "
"remove the addressof?", callee);
- else if ((TYPE_PRECISION (TREE_TYPE (type))
- == TYPE_PRECISION (char_type_node))
+ else if ((INTEGRAL_TYPE_P (TREE_TYPE (type))
+ && (TYPE_PRECISION (TREE_TYPE (type))
+ == TYPE_PRECISION (char_type_node)))
|| strop)
warning_at (loc, OPT_Wsizeof_pointer_memaccess,
"argument to %<sizeof%> in %qD call is the same "
@@ -1064,8 +1067,9 @@ sizeof_pointer_memaccess_warning (location_t *sizeof_arg_loc, tree callee,
"argument to %<sizeof%> in %qD call is the same "
"expression as the second source; did you mean to "
"remove the addressof?", callee);
- else if ((TYPE_PRECISION (TREE_TYPE (type))
- == TYPE_PRECISION (char_type_node))
+ else if ((INTEGRAL_TYPE_P (TREE_TYPE (type))
+ && (TYPE_PRECISION (TREE_TYPE (type))
+ == TYPE_PRECISION (char_type_node)))
|| strop)
warning_at (loc, OPT_Wsizeof_pointer_memaccess,
"argument to %<sizeof%> in %qD call is the same "