* opts-common.c (integral_argument): Set errno properly in one case.
* gcc.dg/diag-sanity.c: New test.
From-SVN: r270022
+2019-03-29 Roman Zhuykov <zhroma@ispras.ru>
+
+ * opts-common.c (integral_argument): Set errno properly in one case.
+
2019-03-29 Martin Liska <mliska@suse.cz>
* doc/invoke.texi: Remove -Wchkp from documentation.
value = strtoull (arg, &end, 0);
if (*end)
{
- /* errno is most likely EINVAL here. */
- *err = errno;
+ if (errno)
+ *err = errno;
+ else
+ *err = EINVAL;
return -1;
}
+2019-03-29 Roman Zhuykov <zhroma@ispras.ru>
+
+ * gcc.dg/diag-sanity.c: New test.
+
2019-03-29 Marek Polacek <polacek@redhat.com>
PR c++/89871
--- /dev/null
+/* Verify that an invalid argument is diagnosed correcly.
+ { dg-do compile }
+ { dg-options "-fdiagnostics-minimum-margin-width=42xyz -flto-compression-level=2-O2" } */
+
+
+/* { dg-error "argument to '-fdiagnostics-minimum-margin-width=' should be a non-negative integer" "" { target *-*-* } 0 }
+ { dg-error "argument to '-flto-compression-level=' should be a non-negative integer" "" { target *-*-* } 0 } */