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

Behan Webster behanw at converseincode.com
Mon Nov 17 07:49:25 UTC 2014

Mainline just accepted a patch to set the default std to gnu89 to work
around the new gcc5 setting the default to gnu11 which breaks kernel
compilation. What follows is one of the reasons they did this (for which
we should see what clang is doing).

I think we all missed this thread on LKML the first time around.

I'm not sure what the consequences are to our efforts with clang yet
(since it is a gnu99 compiler), but this change broke one of our patches
that I've just fixed and uploaded.

More investigation is needed considering that we've spent so much time
trying to get much of the x86/arm/aarch64 code working with c99 semantics.

Fortunately it seems it is a temporary hack until a better solution can
be found...



-------- Forwarded Message --------
Subject: 	Re: [PATCH] kernel: use the gnu89 standard explicitly
Date: 	Mon, 20 Oct 2014 02:21:24 +0300
From: 	Kirill A. Shutemov <kirill at shutemov.name>
To: 	Linus Torvalds <torvalds at linux-foundation.org>
CC: 	Aaro Koskinen <aaro.koskinen at iki.fi>, Andrew Pinski
<pinskia at gmail.com>, Sasha Levin <sasha.levin at oracle.com>, Andrew Morton
<akpm at linux-foundation.org>, Linux Kernel Mailing List
<linux-kernel at vger.kernel.org>

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.koskinen at iki.fi> wrote:
> > >
> > > Here's one example how it fails: http://marc.info/?l=gcc&m=141349914632010&w=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 reported this as a gcc bug? That email may be on the gcc
> > list, but I'm not seeing anybody acknowledge it as a bug..
> > 
> > I cannot imagine that anybody sane claims that this is *wanted*
> > behavior from "gnu11".
> 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.

In some places we can just drop the cast, but it doesn't work everywhere.
I don't see a way to get pre-c99 semantics here.

 Kirill A. Shutemov
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

More information about the LLVMLinux mailing list