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)
Thu, Dec 25, 8:37 AM
Unknown Object (File)
Wed, Dec 24, 9:27 PM
Unknown Object (File)
Mon, Dec 22, 6:54 PM
Unknown Object (File)
Dec 2 2025, 6:34 AM
Unknown Object (File)
Dec 1 2025, 8:02 PM
Unknown Object (File)
Nov 29 2025, 8:34 AM
Unknown Object (File)
Nov 27 2025, 1:40 PM
Unknown Object (File)
Nov 27 2025, 2:57 AM
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.