From owner-svn-src-stable-11@freebsd.org Sun Jun 17 17:24:58 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4EA51002F56; Sun, 17 Jun 2018 17:24:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 661A4767CF; Sun, 17 Jun 2018 17:24:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45499185AF; Sun, 17 Jun 2018 17:24:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HHOwJH022428; Sun, 17 Jun 2018 17:24:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HHOwVk022427; Sun, 17 Jun 2018 17:24:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806171724.w5HHOwVk022427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 17 Jun 2018 17:24:58 +0000 (UTC) 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 X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/sys/dev/drm2/i915 X-SVN-Commit-Revision: 335288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2018 17:24:58 -0000 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",