Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jun 2018 17:24:58 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r335288 - stable/11/sys/dev/drm2/i915
Message-ID:  <201806171724.w5HHOwVk022427@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Sun Jun 17 17:24:57 2018
New Revision: 335288
URL: https://svnweb.freebsd.org/changeset/base/335288

Log:
  MFC r334946:
  
  Fix build of i915kms with base gcc
  
  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, put it in a #if/#endif block.
  
  Reviewed by:	kib
  Differential Revision: https://reviews.freebsd.org/D15744

Modified:
  stable/11/sys/dev/drm2/i915/intel_display.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/drm2/i915/intel_display.c
==============================================================================
--- stable/11/sys/dev/drm2/i915/intel_display.c	Sun Jun 17 17:10:35 2018	(r335287)
+++ stable/11/sys/dev/drm2/i915/intel_display.c	Sun Jun 17 17:24:57 2018	(r335288)
@@ -8872,7 +8872,15 @@ static int intel_dmi_reverse_brightness(const struct d
 
 static const struct intel_dmi_quirk intel_dmi_quirks[] = {
 	{
-		.dmi_id_list = &(const struct dmi_system_id[]) {
+		.dmi_id_list =
+#if !defined(__clang__) && !__GNUC_PREREQ__(4, 3)
+		    /* gcc 4.2 needs an additional cast, to avoid a bogus
+		     * "initialization from incompatible pointer type" warning.
+		     * see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36432
+		     */
+		    (const struct dmi_system_id (*)[])
+#endif
+		    &(const struct dmi_system_id[]) {
 			{
 				.callback = intel_dmi_reverse_brightness,
 				.ident = "NCR Corporation",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806171724.w5HHOwVk022427>