*sizstr = '\0';
/* Set if a warning has been issued for the current argument. */
- opt_code arg_warned = N_OPTS;
+ opt_code arg_warned = no_warning;
location_t loc = EXPR_LOCATION (exp);
tree ptr = access.second.ptr;
if (*sizstr
exp, sizidx + 1, sizstr))
arg_warned = OPT_Wstringop_overflow_;
- if (arg_warned != N_OPTS)
+ if (arg_warned != no_warning)
{
append_attrname (access, attrstr, sizeof attrstr);
/* Remember a warning has been issued and avoid warning
arg_warned = OPT_Wnonnull;
}
- if (arg_warned)
+ if (arg_warned != no_warning)
{
append_attrname (access, attrstr, sizeof attrstr);
/* Remember a warning has been issued and avoid warning
--- /dev/null
+/* PR middle-end/101216 - spurious notes for function calls
+ { dg-do compile }
+ { dg-options "-O2 -w" } */
+
+__attribute__ ((access (write_only, 1, 2))) char*
+getcwd (char *, __SIZE_TYPE__);
+
+char* f (void)
+{
+ char a[8];
+ return getcwd (0, 8);
+}
+
+/* Expect no messages of any kind on output.
+ { dg-bogus "" "" { target *-*-* } 0 } */