Bug 105088

Summary: brw_nir_uniforms.cpp:256:10: error: non-constant-expression cannot be narrowed
Product: Mesa Reporter: Vinson Lee <vlee>
Component: Drivers/DRI/i965Assignee: Jason Ekstrand <jason>
Status: RESOLVED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

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.