gcc47: Backport static initialization acceptance.
commit8172914b41e0b50782e103828c8770bcdac543f1
authorzrj <rimvydas.jasinskas@gmail.com>
Fri, 17 Nov 2017 10:21:09 +0000 (17 12:21 +0200)
committerzrj <zrj@dragonflybsd.org>
Fri, 17 Nov 2017 11:32:37 +0000 (17 13:32 +0200)
tree015733e0a8bd34282539acf6875f8843da094c1c
parent69a0f59f4dd0c896847210afdc0277a040855662
gcc47: Backport static initialization acceptance.

I only backporting these so that failing to accept drm/i915 _MMIO() stuff
would *not* be used as an argument to remove gcc47 alternative compiler
from base, just because "oh look it does not compile the i915.ko".
The gcc47 is likely the last C compiler compilable with C compiler able
to bootstrap the c++ compiler that is used on x86_64 anymore.
If anyone has/works on simple C compiler that could boostrap modern gcc,
you know where I hanging out and I gladly replace gcc47 with it in base.

It only takes few lines to accept updated drm/i915 "features".
It still warns with -pedantic:
/usr/src/sys/dev/drm/i915/intel_pm.c:3925:3: warning: initializer element is not constant [-pedantic]
/usr/src/sys/dev/drm/i915/intel_pm.c:3925:3: warning: (near initialization for 'wm0_pipe_reg[0]') [-pedantic]
/usr/src/sys/dev/drm/i915/intel_pm.c:3926:3: warning: initializer element is not constant [-pedantic]
/usr/src/sys/dev/drm/i915/intel_pm.c:3926:3: warning: (near initialization for 'wm0_pipe_reg[1]') [-pedantic]
/usr/src/sys/dev/drm/i915/intel_pm.c:3927:3: warning: initializer element is not constant [-pedantic]
/usr/src/sys/dev/drm/i915/intel_pm.c:3927:3: warning: (near initialization for 'wm0_pipe_reg[2]') [-pedantic]
...
So far i915 is the only place in kernel that does this, please lets keep it at this.

Check C99 Standard: Section 6.7.8 for more info.

Taken-from: gcc trunk (216416 + 216440 revisions)
contrib/gcc-4.7/gcc/c-typeck.c