https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115566

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
/* If TYPE is an array type and EXPR is a parenthesized string
   constant, warn if pedantic that EXPR is being used to initialize an
   object of type TYPE.  */

void
maybe_warn_string_init (location_t loc, tree type, struct c_expr expr)
{
  if (pedantic
      && TREE_CODE (type) == ARRAY_TYPE
      && TREE_CODE (expr.value) == STRING_CST
      && expr.original_code != STRING_CST)
    pedwarn_init (loc, OPT_Wpedantic,
                  "array initialized from parenthesized string constant");
}

Reply via email to