Summary: | st_nir.h:34: error: redefinition of typedef ‘nir_shader’ | ||
---|---|---|---|
Product: | Mesa | Reporter: | Vinson Lee <vlee> |
Component: | Mesa core | Assignee: | mesa-dev |
Status: | RESOLVED FIXED | QA Contact: | mesa-dev |
Severity: | normal | ||
Priority: | medium | Keywords: | regression |
Version: | git | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Vinson Lee
2016-05-27 05:03:35 UTC
Using the forward declaration allows us to avoid including the nir.h header, thus keeping headers include chain shorter and less things get rebuild as a result. On the other hand, typedef redefinition is a C11 feature (iirc) which we cannot enforce atm. There was a lengthy discussion about killing off the typedefs in NIR, as they made sense in the C++ GLSL but not the C based NIR. Don't recall the conclusion of the thread, but fwiw I'm for killing the typedefs thus being able to build mesa with GCC 4.x series and (in due time) killing off the unneeded includes of nir*.h and replacing them with fwd declarations. commit 3fea592c4eb26f6652bef1e5dc430e2296e14bac Author: Vinson Lee <vlee@freedesktop.org> Date: Wed Jun 29 20:15:03 2016 -0700 mesa/st: Use 'struct nir_shader' instead of 'nir_shader'. Fix this build error with GCC 4.4. CC state_tracker/st_nir_lower_builtin.lo In file included from state_tracker/st_nir_lower_builtin.c:61: state_tracker/st_nir.h:34: error: redefinition of typedef ‘nir_shader’ ../../src/compiler/nir/nir.h:1830: note: previous declaration of ‘nir_shader’ was here Suggested-by: Rob Clark <robdclark@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96235 Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Rob Clark <robdclark@gmail.com> |
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.