... and quiet -Wnonnull in a different way.
gdb/testsuite/ChangeLog:
2017-05-18 Pedro Alves <palves@redhat.com>
* gdb.base/fileio.c (null_str): New global.
(test_stat): Use it.
* gdb.base/fileio.exp: Remove nowarnings.
+2017-05-18 Pedro Alves <palves@redhat.com>
+
+ * gdb.base/fileio.c (null_str): New global.
+ (test_stat): Use it.
+ * gdb.base/fileio.exp: Remove nowarnings.
+
2017-05-17 Yao Qi <yao.qi@linaro.org>
* gdb.base/fileio.exp: Pass nowarnings to gdb_compile.
static void stop () {}
+/* A NULL string. We pass this to stat below instead of a NULL
+ literal to avoid -Wnonnull warnings. */
+const char *null_str;
+
int
test_open ()
{
stop ();
/* NULL pathname */
errno = 0;
- ret = stat (NULL, &st);
+ ret = stat (null_str, &st);
printf ("stat 2: ret = %d, errno = %d %s\n", ret, errno,
strerrno (errno));
stop ();
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
executable \
- [list debug nowarnings "additional_flags=-DOUTDIR=\"$outdir/\""]] != "" } {
+ [list debug "additional_flags=-DOUTDIR=\"$outdir/\""]] != "" } {
untested "failed to compile"
return -1
}