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)
Feb 25 2024, 12:11 AM
Unknown Object (File)
Feb 7 2024, 9:36 AM
Unknown Object (File)
Nov 28 2023, 4:30 PM
Unknown Object (File)
Oct 27 2023, 3:29 PM
Unknown Object (File)
Oct 25 2023, 1:32 AM
Unknown Object (File)
Sep 22 2023, 10:33 AM
Unknown Object (File)
Sep 1 2023, 7:06 AM
Unknown Object (File)
Aug 13 2023, 1:51 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 Not Applicable
Unit
Tests Not Applicable

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.