lkml.org 
[lkml]   [2019]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [GIT PULL] MIPS changes
On Tue, Sep 24, 2019 at 5:40 AM David Howells <dhowells@redhat.com> wrote:
>
> Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> > In honesty, I actually do have one warning in my tree:
> >
> > samples/vfs/test-statx.c:24:15: warning: ‘struct foo’ declared
> > inside parameter list
>
> Were there any note lines from the compiler associated with this? The warning
> message can't actually be taking place on this line.

That's the only thing that gcc says. I agree that it's not where the
problem occurs, but the gcc warning system tries to avoid warning
inside system header files, so it seems to have logic tracing it back
to the user.

But I have system header files that look like this:

/* Fill *BUF with information about PATH in DIRFD. */
int statx (int __dirfd, const char *__restrict __path, int __flags,
unsigned int __mask, struct statx *__restrict __buf)
__THROW __nonnull ((2, 5));

and I think that's the one that triggers.

You must have hit *something* similar too, since the only reason for that

#define statx foo
#define statx_timestamp foo_timestamp
#include <sys/stat.h>
#undef statx
#undef statx_timestamp

is that you're playing games with the kernel 'statx' clashing with
user 'statx' use.

And what I think happens is that you had the <sys/types.h> include
*without* that #define, so the 'struct statx' got declared there, and
then in <sys/stat.h> it gets used, but it gets used as 'struct foo',
so now the compiler complains (properly) that you're using this
undeclared 'struct foo' in the function declaration, and because of
namespace rules it's not the same thing as then a later 'struct foo'
would be.

Linus

Linus

\
 
 \ /
  Last update: 2019-09-24 17:33    [W:0.061 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site