Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1408357 > unrolled thread
| Started by | Boris Ostrovsky <boris.ostrovsky@oracle.com> |
|---|---|
| First post | 2016-05-28 02:20 +0200 |
| Last post | 2016-05-28 02:40 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
Re: [GIT PULL] Please pull NFS client changes for Linux 4.7 Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-05-28 02:20 +0200
Re: [GIT PULL] Please pull NFS client changes for Linux 4.7 Linus Torvalds <torvalds@linux-foundation.org> - 2016-05-28 02:40 +0200
| From | Boris Ostrovsky <boris.ostrovsky@oracle.com> |
|---|---|
| Date | 2016-05-28 02:20 +0200 |
| Subject | Re: [GIT PULL] Please pull NFS client changes for Linux 4.7 |
| Message-ID | <rDA8V-1UR-5@gated-at.bofh.it> |
----- torvalds@linux-foundation.org wrote: > On Fri, May 27, 2016 at 10:14 AM, Boris Ostrovsky > <boris.ostrovsky@oracle.com> wrote: > > > > This breaks on older compilers: > > > > CC fs/nfs/nfs4state.o > > /home/build/linux-linus/fs/nfs/nfs4state.c:69: error: unknown field > > ‘data’ specified in initializer > > Does the attached patch fix it for you? > > I don't have easy access to the old compiler, but I _think_ the > trivial patch of just adding braces around the data initializer > should > make old gcc's happy It does fix it. This is not the first time we've hit this and people have always been changing code to initialize fields in execution path (and I didn't fix it here myself because I wasn't sure where to do that). I guess we could have been just adding braces all along. Thanks. -boris
[toc] | [next] | [standalone]
| From | Linus Torvalds <torvalds@linux-foundation.org> |
|---|---|
| Date | 2016-05-28 02:40 +0200 |
| Message-ID | <rDAsh-21c-9@gated-at.bofh.it> |
| In reply to | #1408357 |
On Fri, May 27, 2016 at 5:17 PM, Boris Ostrovsky
<boris.ostrovsky@oracle.com> wrote:
>
> It does fix it.
Ok, I've committed that in my tree, will do my usual build test and push out.
> This is not the first time we've hit this and people have always been
> changing code to initialize fields in execution path (and I didn't fix
> it here myself because I wasn't sure where to do that). I guess we
> could have been just adding braces all along.
Well, adding the braces also requires that you get the *order* of the
member initialization right, since the braces will be unnamed.
In this case, the unnamed union was the first member, so the trivial
patch worked, but that's not always the case.
In fact, in this case, I think an alternate and possibly better fix
would have been to just remove the ".data = { 0 }" initializer
entirely, since in its absence it would have been initialized to zero
anyway.
But since you already tested my uglier "just add a brace like the
error message suggests" that's the one I'll be committing.
It's a fairly annoying failure of older compilers, exactly because
people with newer compilers won't even realize that they are causing
problems.
Linus
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web