Page MenuHomeFreeBSD

Fix build of i915kms with base gcc
ClosedPublic

Authored by dim on Jun 10 2018, 8:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 8, 4:05 PM
Unknown Object (File)
Mon, May 4, 4:52 PM
Unknown Object (File)
Thu, Apr 30, 8:09 AM
Unknown Object (File)
Mon, Apr 27, 9:43 PM
Unknown Object (File)
Sun, Apr 26, 6:00 AM
Unknown Object (File)
Thu, Apr 23, 4:25 PM
Unknown Object (File)
Tue, Apr 21, 9:14 AM
Unknown Object (File)
Apr 7 2026, 5:11 PM
Subscribers

Details

Summary

Base gcc fails to compile sys/dev/drm2/i915/intel_display.c for i386,
with the following -Werror warnings:

cc1: warnings being treated as errors
/usr/src/sys/dev/drm2/i915/intel_display.c:8884: warning: initialization from incompatible pointer type

This is due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36432, which
incorrectly interprets the [] as a flexible array member.

Because base gcc does not have a -W flag to suppress this particular
warning, it requires a rather ugly cast. To not influence any other
compiler, I have put it in a #if/#endif block.

We could alternatively:

  • Do the cast unconditionally (with a remark that this is to appease gcc)
  • Turn off -Werror for gcc 4.2.1, maybe even only for intel_display.c

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17148
Build 17001: arc lint + arc unit

Event Timeline

dim retitled this revision from Fix build of i915kms with base gcc on i386 to Fix build of i915kms with base gcc.Jun 10 2018, 8:14 PM
This revision is now accepted and ready to land.Jun 10 2018, 8:58 PM
This revision was automatically updated to reflect the committed changes.