Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Al Viro
On Sun, Oct 19, 2014 at 05:23:04PM -0700, Linus Torvalds wrote: > So now we have a *third* semantic of "extern inline", and one that > seems to be entirely inappropriate to *ever* be used in a header file > due to duplicate symbol problems. What a mess. > > Maybe we should just specify "gnu89"

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Linus Torvalds
On Sun, Oct 19, 2014 at 4:59 PM, Sasha Levin wrote: > >> AndrewP, mind explaing the other difference you mentioned (ie wrt >> "extern inline")? I thought we had already long since ended up >> following the gcc semantics (ie use "static inline" if we don't have >> an external version somehwre),

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Sasha Levin
On 10/19/2014 07:49 PM, Linus Torvalds wrote: > On Sun, Oct 19, 2014 at 4:10 PM, Kirill A. Shutemov > wrote: >> > >> > IIUC, it's nothing to do with volatile. C11 and above reads >> > >> > (rwlock_t) { .raw_lock = { 0 }, } >> > >> > as compound literal (which is not constant) rather than

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Sasha Levin
On 10/19/2014 04:05 PM, Linus Torvalds wrote: > On Sun, Oct 19, 2014 at 9:07 AM, Sasha Levin wrote: >> > gcc5 changes the default standard to c11, rather than gnu89, which >> > makes kernel build unhappy. > Hmm. Just how unhappy does it make it? Maybe we can instead try to > make the build

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Linus Torvalds
On Sun, Oct 19, 2014 at 4:10 PM, Kirill A. Shutemov wrote: > > IIUC, it's nothing to do with volatile. C11 and above reads > > (rwlock_t) { .raw_lock = { 0 }, } > > as compound literal (which is not constant) rather than constant > initalizer plus a cast. Ahh. I thought it was the

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread pinskia
> On Oct 19, 2014, at 4:05 PM, Linus Torvalds > wrote: > >> On Sun, Oct 19, 2014 at 2:03 PM, Aaro Koskinen wrote: >> >> Here's one example how it fails: >> http://marc.info/?l=gcc=141349914632010=2 > > Ok, that just looks like a gnu11 bug, then. Not being able to > initialize structures

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Al Viro
On Mon, Oct 20, 2014 at 02:21:24AM +0300, Kirill A. Shutemov wrote: > s/C11/C99/ > > > > > (rwlock_t) { .raw_lock = { 0 }, } > > > > as compound literal (which is not constant) rather than constant > > initalizer plus a cast. > > In some places we can just drop the cast, but it doesn't

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Kirill A. Shutemov
On Mon, Oct 20, 2014 at 02:10:31AM +0300, Kirill A. Shutemov wrote: > On Sun, Oct 19, 2014 at 04:05:25PM -0700, Linus Torvalds wrote: > > On Sun, Oct 19, 2014 at 2:03 PM, Aaro Koskinen wrote: > > > > > > Here's one example how it fails: > > > http://marc.info/?l=gcc=141349914632010=2 > > > >

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Al Viro
On Mon, Oct 20, 2014 at 02:10:31AM +0300, Kirill A. Shutemov wrote: > On Sun, Oct 19, 2014 at 04:05:25PM -0700, Linus Torvalds wrote: > > On Sun, Oct 19, 2014 at 2:03 PM, Aaro Koskinen wrote: > > > > > > Here's one example how it fails: > > > http://marc.info/?l=gcc=141349914632010=2 > > > >

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Kirill A. Shutemov
On Sun, Oct 19, 2014 at 04:05:25PM -0700, Linus Torvalds wrote: > On Sun, Oct 19, 2014 at 2:03 PM, Aaro Koskinen wrote: > > > > Here's one example how it fails: > > http://marc.info/?l=gcc=141349914632010=2 > > Ok, that just looks like a gnu11 bug, then. Not being able to > initialize

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Linus Torvalds
On Sun, Oct 19, 2014 at 2:03 PM, Aaro Koskinen wrote: > > Here's one example how it fails: http://marc.info/?l=gcc=141349914632010=2 Ok, that just looks like a gnu11 bug, then. Not being able to initialize structures because some sub-structure has a volatile member is just pure BS. Has anybody

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Kirill A. Shutemov
On Sun, Oct 19, 2014 at 12:07:42PM -0400, Sasha Levin wrote: > gcc5 changes the default standard to c11, rather than gnu89, which > makes kernel build unhappy. > > Explicitly define the kernel standard to be gnu89 which should > keep everything working exactly like it was before gcc5. > >

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Joe Perches
On Sun, 2014-10-19 at 13:46 -0700, Linus Torvalds wrote: > On Oct 19, o2014 1:24 PM, "Joe Perches" wrote: > > > > I think it'd be moderately painful. > > > > There are ~1000 uses of variables like " new" in the kernel. > > So? That's not a C11 violation last I saw. The whole "new" keyword is

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Aaro Koskinen
Hi, On Sun, Oct 19, 2014 at 01:05:22PM -0700, Linus Torvalds wrote: > On Sun, Oct 19, 2014 at 9:07 AM, Sasha Levin wrote: > > gcc5 changes the default standard to c11, rather than gnu89, which > > makes kernel build unhappy. (I guess the default will be gnu11 instead of c11.) > Hmm. Just how

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Joe Perches
On Sun, 2014-10-19 at 13:05 -0700, Linus Torvalds wrote: > On Sun, Oct 19, 2014 at 9:07 AM, Sasha Levin wrote: > > gcc5 changes the default standard to c11, rather than gnu89, which > > makes kernel build unhappy. > > Hmm. Just how unhappy does it make it? Maybe we can instead try to > make the

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Linus Torvalds
On Sun, Oct 19, 2014 at 9:07 AM, Sasha Levin wrote: > gcc5 changes the default standard to c11, rather than gnu89, which > makes kernel build unhappy. Hmm. Just how unhappy does it make it? Maybe we can instead try to make the build happier with some minimal changes? Or is it really painful?

[PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Sasha Levin
gcc5 changes the default standard to c11, rather than gnu89, which makes kernel build unhappy. Explicitly define the kernel standard to be gnu89 which should keep everything working exactly like it was before gcc5. Signed-off-by: Sasha Levin --- Makefile |3 ++- 1 file changed, 2

[PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Sasha Levin
gcc5 changes the default standard to c11, rather than gnu89, which makes kernel build unhappy. Explicitly define the kernel standard to be gnu89 which should keep everything working exactly like it was before gcc5. Signed-off-by: Sasha Levin sasha.le...@oracle.com --- Makefile |3 ++- 1

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Linus Torvalds
On Sun, Oct 19, 2014 at 9:07 AM, Sasha Levin sasha.le...@oracle.com wrote: gcc5 changes the default standard to c11, rather than gnu89, which makes kernel build unhappy. Hmm. Just how unhappy does it make it? Maybe we can instead try to make the build happier with some minimal changes? Or is it

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Joe Perches
On Sun, 2014-10-19 at 13:05 -0700, Linus Torvalds wrote: On Sun, Oct 19, 2014 at 9:07 AM, Sasha Levin sasha.le...@oracle.com wrote: gcc5 changes the default standard to c11, rather than gnu89, which makes kernel build unhappy. Hmm. Just how unhappy does it make it? Maybe we can instead try

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Aaro Koskinen
Hi, On Sun, Oct 19, 2014 at 01:05:22PM -0700, Linus Torvalds wrote: On Sun, Oct 19, 2014 at 9:07 AM, Sasha Levin sasha.le...@oracle.com wrote: gcc5 changes the default standard to c11, rather than gnu89, which makes kernel build unhappy. (I guess the default will be gnu11 instead of c11.)

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Joe Perches
On Sun, 2014-10-19 at 13:46 -0700, Linus Torvalds wrote: On Oct 19, o2014 1:24 PM, Joe Perches j...@perches.com wrote: I think it'd be moderately painful. There are ~1000 uses of variables like some_type new in the kernel. So? That's not a C11 violation last I saw. The whole new

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Kirill A. Shutemov
On Sun, Oct 19, 2014 at 12:07:42PM -0400, Sasha Levin wrote: gcc5 changes the default standard to c11, rather than gnu89, which makes kernel build unhappy. Explicitly define the kernel standard to be gnu89 which should keep everything working exactly like it was before gcc5.

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Linus Torvalds
On Sun, Oct 19, 2014 at 2:03 PM, Aaro Koskinen aaro.koski...@iki.fi wrote: Here's one example how it fails: http://marc.info/?l=gccm=141349914632010w=2 Ok, that just looks like a gnu11 bug, then. Not being able to initialize structures because some sub-structure has a volatile member is just

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Kirill A. Shutemov
On Sun, Oct 19, 2014 at 04:05:25PM -0700, Linus Torvalds wrote: On Sun, Oct 19, 2014 at 2:03 PM, Aaro Koskinen aaro.koski...@iki.fi wrote: Here's one example how it fails: http://marc.info/?l=gccm=141349914632010w=2 Ok, that just looks like a gnu11 bug, then. Not being able to

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Al Viro
On Mon, Oct 20, 2014 at 02:10:31AM +0300, Kirill A. Shutemov wrote: On Sun, Oct 19, 2014 at 04:05:25PM -0700, Linus Torvalds wrote: On Sun, Oct 19, 2014 at 2:03 PM, Aaro Koskinen aaro.koski...@iki.fi wrote: Here's one example how it fails: http://marc.info/?l=gccm=141349914632010w=2

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Kirill A. Shutemov
On Mon, Oct 20, 2014 at 02:10:31AM +0300, Kirill A. Shutemov wrote: On Sun, Oct 19, 2014 at 04:05:25PM -0700, Linus Torvalds wrote: On Sun, Oct 19, 2014 at 2:03 PM, Aaro Koskinen aaro.koski...@iki.fi wrote: Here's one example how it fails: http://marc.info/?l=gccm=141349914632010w=2

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Al Viro
On Mon, Oct 20, 2014 at 02:21:24AM +0300, Kirill A. Shutemov wrote: s/C11/C99/ (rwlock_t) { .raw_lock = { 0 }, } as compound literal (which is not constant) rather than constant initalizer plus a cast. In some places we can just drop the cast, but it doesn't work everywhere.

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread pinskia
On Oct 19, 2014, at 4:05 PM, Linus Torvalds torva...@linux-foundation.org wrote: On Sun, Oct 19, 2014 at 2:03 PM, Aaro Koskinen aaro.koski...@iki.fi wrote: Here's one example how it fails: http://marc.info/?l=gccm=141349914632010w=2 Ok, that just looks like a gnu11 bug, then. Not

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Linus Torvalds
On Sun, Oct 19, 2014 at 4:10 PM, Kirill A. Shutemov kir...@shutemov.name wrote: IIUC, it's nothing to do with volatile. C11 and above reads (rwlock_t) { .raw_lock = { 0 }, } as compound literal (which is not constant) rather than constant initalizer plus a cast. Ahh. I thought it

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Sasha Levin
On 10/19/2014 04:05 PM, Linus Torvalds wrote: On Sun, Oct 19, 2014 at 9:07 AM, Sasha Levin sasha.le...@oracle.com wrote: gcc5 changes the default standard to c11, rather than gnu89, which makes kernel build unhappy. Hmm. Just how unhappy does it make it? Maybe we can instead try to make the

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Sasha Levin
On 10/19/2014 07:49 PM, Linus Torvalds wrote: On Sun, Oct 19, 2014 at 4:10 PM, Kirill A. Shutemov kir...@shutemov.name wrote: IIUC, it's nothing to do with volatile. C11 and above reads (rwlock_t) { .raw_lock = { 0 }, } as compound literal (which is not constant) rather than

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Linus Torvalds
On Sun, Oct 19, 2014 at 4:59 PM, Sasha Levin sasha.le...@oracle.com wrote: AndrewP, mind explaing the other difference you mentioned (ie wrt extern inline)? I thought we had already long since ended up following the gcc semantics (ie use static inline if we don't have an external version

Re: [PATCH] kernel: use the gnu89 standard explicitly

2014-10-19 Thread Al Viro
On Sun, Oct 19, 2014 at 05:23:04PM -0700, Linus Torvalds wrote: So now we have a *third* semantic of extern inline, and one that seems to be entirely inappropriate to *ever* be used in a header file due to duplicate symbol problems. What a mess. Maybe we should just specify gnu89 to avoid