]> git.baikalelectronics.ru Git - kernel.git/commit
kernel: use the gnu89 standard explicitly
authorKirill A. Shutemov <kirill@shutemov.name>
Mon, 20 Oct 2014 09:23:12 +0000 (12:23 +0300)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 15 Nov 2014 22:29:55 +0000 (14:29 -0800)
commit1a47ae6e3d0892653d7a08e8ffed1a5f8164976b
tree27720bcaf036b70f4bd70cd7c75645ba08860d57
parent970559953031d0a5dbdd4039b241d4701d0eec2a
kernel: use the gnu89 standard explicitly

Sasha Levin reports:
 "gcc5 changes the default standard to c11, which makes kernel build
  unhappy

  Explicitly define the kernel standard to be gnu89 which should keep
  everything working exactly like it was before gcc5"

There are multiple small issues with the new default, but the biggest
issue seems to be that the old - and very useful - GNU extension to
allow a cast in front of an initializer has gone away.

Patch updated by Kirill:
 "I'm pretty sure all gcc versions you can build kernel with supports
  -std=gnu89.  cc-option is redunrant.

  We also need to adjust HOSTCFLAGS otherwise allmodconfig fails for me"

Note by Andrew Pinski:
 "Yes it was reported and both problems relating to this extension has
  been added to gnu99 and gnu11.  Though there are other issues with the
  kernel dealing with extern inline have different semantics between
  gnu89 and gnu99/11"

End result: we may be able to move up to a newer stdc model eventually,
but right now the newer models have some annoying deficiencies, so the
traditional "gnu89" model ends up being the preferred one.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Singed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Makefile