+2017-10-11 Martin Liska <mliska@suse.cz>
+
+ PR sanitizer/82490
+ * opts.c (parse_no_sanitize_attribute): Do not use error_value
+ variable.
+ * opts.h (parse_no_sanitize_attribute): Remove last argument.
+
2017-10-11 Martin Liska <mliska@suse.cz>
* print-rtl.c (print_insn): Move declaration of idbuf
+2017-10-11 Martin Liska <mliska@suse.cz>
+
+ PR sanitizer/82490
+ * c-attribs.c (handle_no_sanitize_attribute): Report directly
+ Wattributes warning.
+
2017-10-10 Richard Sandiford <richard.sandiford@linaro.org>
* c-ada-spec.c (dump_generic_ada_node): Use wi::to_wide when
return NULL_TREE;
}
- char *error_value = NULL;
char *string = ASTRDUP (TREE_STRING_POINTER (id));
- unsigned int flags = parse_no_sanitize_attribute (string, &error_value);
-
- if (error_value)
- {
- error ("wrong argument: \"%s\"", error_value);
- return NULL_TREE;
- }
+ unsigned int flags = parse_no_sanitize_attribute (string);
add_no_sanitize_value (*node, flags);
}
/* Parse string values of no_sanitize attribute passed in VALUE.
- Values are separated with comma. Wrong argument is stored to
- WRONG_ARGUMENT variable. */
+ Values are separated with comma. */
unsigned int
-parse_no_sanitize_attribute (char *value, char **wrong_argument)
+parse_no_sanitize_attribute (char *value)
{
unsigned int flags = 0;
unsigned int i;
}
if (sanitizer_opts[i].name == NULL)
- *wrong_argument = q;
+ warning (OPT_Wattributes,
+ "%<%s%> attribute directive ignored", q);
q = strtok (NULL, ",");
}
unsigned int parse_sanitizer_options (const char *, location_t, int,
unsigned int, int, bool);
-unsigned int parse_no_sanitize_attribute (char *value, char **wrong_argument);
+unsigned int parse_no_sanitize_attribute (char *value);
extern bool common_handle_option (struct gcc_options *opts,
struct gcc_options *opts_set,
const struct cl_decoded_option *decoded,
+2017-10-11 Martin Liska <mliska@suse.cz>
+
+ PR sanitizer/82490
+ * c-c++-common/ubsan/attrib-5.c: New test.
+
2017-10-11 Martin Liska <mliska@suse.cz>
Revert r253637:
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fsanitize=undefined" } */
+
+__attribute__((no_sanitize("foobar")))
+static void
+float_cast2 (void)
+{ /* { dg-warning "attribute directive ignored" } */
+ volatile double d = 300;
+ volatile signed char c;
+ c = d;
+}