Bug 105088 - brw_nir_uniforms.cpp:256:10: error: non-constant-expression cannot be narrowed
Summary: brw_nir_uniforms.cpp:256:10: error: non-constant-expression cannot be narrowed
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Jason Ekstrand
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-14 07:45 UTC by Vinson Lee
Modified: 2018-02-14 23:14 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2018-02-14 07:45:11 UTC
Build error with clang 6.0.

  CXX      brw_nir_uniforms.lo
warning: unknown warning option '-Wno-override-init'; did you mean
      '-Wno-override-module'? [-Wunknown-warning-option]
brw_nir_uniforms.cpp:256:10: error: non-constant-expression cannot be narrowed
      from type 'gl_state_index_' to 'gl_state_index16' (aka 'short') in
      initializer list [-Wc++11-narrowing]
         nir->info.stage == MESA_SHADER_TESS_CTRL ?
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
brw_nir_uniforms.cpp:256:10: note: insert an explicit cast to silence this issue
         nir->info.stage == MESA_SHADER_TESS_CTRL ?
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         static_cast<gl_state_index16>(
Comment 1 Kenneth Graunke 2018-02-14 19:43:51 UTC
Jason sent a patch for this.
Comment 2 Jason Ekstrand 2018-02-14 23:14:23 UTC
This has been fixed in the following commit:

commit 5c9d47d9c6508b0b01bfadfd129e55886a016ed1
Author: Jason Ekstrand <jason.ekstrand@intel.com>
Date:   Tue Feb 13 14:56:28 2018 -0800

    i965: Add gl_state_index casts for PATCH_VERTICES_IN
    
    This fixes the build in clang
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105088
    Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.