diff mbox

[1/2] xfstests: Add first statx test

Message ID 20170331162723.GA1693@infradead.org (mailing list archive)
State New, archived
Headers show

Commit Message

Christoph Hellwig March 31, 2017, 4:27 p.m. UTC
This only compiles with warnings for me:

stat_test.c: In function 'main':
stat_test.c:557:3: warning: 'sval' may be used uninitialized in this function [-Wmaybe-uninitialized]
   check(sval == scheck,
   ^
stat_test.c:451:20: note: 'sval' was declared here
  long long scheck, sval;
                    ^
stat_test.c:542:3: warning: 'uval' may be used uninitialized in this function [-Wmaybe-uninitialized]
   check(uval == ucheck,
   ^
stat_test.c:450:29: note: 'uval' was declared here
  unsigned long long ucheck, uval;
                             ^

And running it then fails for me on Debian stable:

Comments

David Howells March 31, 2017, 4:48 p.m. UTC | #1
Christoph Hellwig <hch@infradead.org> wrote:

> stat_test.c: In function 'main':
> stat_test.c:557:3: warning: 'sval' may be used uninitialized in this function [-Wmaybe-uninitialized]
>    check(sval == scheck,
>    ^
> ...

I don't see any of these.  gcc is actually wrong about this.  What gcc are you
using?

> +nc: invalid option -- 'U'
> +/bin/nc: invalid option -- 'U'
> +nc -h for helpnc -h for help

Sounds like I need to add my own helper to create AF_UNIX sockets rather than
using netcat.  What version of nc do you have?  Mine is 7.40.

David
Christoph Hellwig March 31, 2017, 5:19 p.m. UTC | #2
On Fri, Mar 31, 2017 at 05:48:17PM +0100, David Howells wrote:
> Christoph Hellwig <hch@infradead.org> wrote:
> 
> > stat_test.c: In function 'main':
> > stat_test.c:557:3: warning: 'sval' may be used uninitialized in this function [-Wmaybe-uninitialized]
> >    check(sval == scheck,
> >    ^
> > ...
> 
> I don't see any of these.  gcc is actually wrong about this.  What gcc are you
> using?

gcc version 4.9.2 (Debian 4.9.2-10) 


> > +nc: invalid option -- 'U'
> > +/bin/nc: invalid option -- 'U'
> > +nc -h for helpnc -h for help
> 
> Sounds like I need to add my own helper to create AF_UNIX sockets rather than
> using netcat.  What version of nc do you have?  Mine is 7.40.

netcat-traditional_1.10-41 from Debian stable.
David Howells March 31, 2017, 5:24 p.m. UTC | #3
Christoph Hellwig <hch@infradead.org> wrote:

> > I don't see any of these.  gcc is actually wrong about this.  What gcc are you
> > using?
> 
> gcc version 4.9.2 (Debian 4.9.2-10) 

Yeah - more recent gccs appear to get this right.  I guess I can either
preclear the variables or maybe I should just split the function.

David
diff mbox

Patch

--- tests/generic/420.out	2017-03-31 16:24:11.643845876 +0000
+++ /root/xfstests/results//generic/420.out.bad	2017-03-31 16:26:23.820512545 +0000
@@ -8,4 +8,10 @@ 
 20+0 records out
 Test statx on a symlink
 Test statx on an AF_UNIX socket
+nc: invalid option -- 'U'
+/bin/nc: invalid option -- 'U'
+nc -h for helpnc -h for help
+
+/mnt/test/420-sock: No such file or directory
 Test a hard link to a file
+/mnt/test/420-sock: No such file or directory