Summary: | glsl_parser_extras.cpp", line 1455: Error: Badly formed expression. (Oracle Studio) | ||
---|---|---|---|
Product: | Mesa | Reporter: | Vinson Lee <vlee> |
Component: | Mesa core | Assignee: | mesa-dev |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | blocker | ||
Priority: | medium | CC: | idr, mattst88 |
Version: | git | Keywords: | bisected, regression |
Hardware: | x86 (IA32) | ||
OS: | Solaris | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Vinson Lee
2014-12-02 22:19:42 UTC
(In reply to Vinson Lee from comment #0) > Build error with Oracle Studio. > > [snip useless warnings] > "../../src/glsl/glsl_parser_extras.cpp", line 1455: Error: Badly formed > expression. I'm not sure what's wrong with + (void) p_atomic_cmpxchg(&ir_variable::temporaries_allocate_names, + false, true); gcc and MSVC seem to accept it. Oh, I bet there's something wrong with the macro. I'd try removing the typeof(*v) cast in src/util/u_atomic.h around line 173. If that fixes it, we should remove those casts from p_atomic_inc_return and p_atomic_dec_return as well. (In reply to Matt Turner from comment #2) > Oh, I bet there's something wrong with the macro. I'd try removing the > typeof(*v) cast in src/util/u_atomic.h around line 173. If that fixes it, we > should remove those casts from p_atomic_inc_return and p_atomic_dec_return > as well. I removed the typeof(*v) cast in u_atomic.h:173. The build gets further and hits a different build error. diff --git a/src/util/u_atomic.h b/src/util/u_atomic.h index 56c5740..afe1b90 100644 --- a/src/util/u_atomic.h +++ b/src/util/u_atomic.h @@ -170,7 +170,7 @@ sizeof(*v) == sizeof(uint64_t) ? atomic_dec_64_nv((uint64_t *)(v)) : \ (assert(!"should not get here"), 0)) -#define p_atomic_cmpxchg(v, old, _new) ((typeof(*v)) \ +#define p_atomic_cmpxchg(v, old, _new) ( \ sizeof(*v) == sizeof(uint8_t) ? atomic_cas_8 ((uint8_t *)(v), (uint8_t )(old), (uint8_t )(_new)) : \ sizeof(*v) == sizeof(uint16_t) ? atomic_cas_16((uint16_t *)(v), (uint16_t)(old), (uint16_t)(_new)) : \ sizeof(*v) == sizeof(uint32_t) ? atomic_cas_32((uint32_t *)(v), (uint32_t)(old), (uint32_t)(_new)) : \ "../../src/gallium/include/pipe/p_compiler.h", line 73: warning: typedef redeclared: uint "../../src/gallium/include/pipe/p_compiler.h", line 75: warning: typedef redeclared: ushort "../../src/gallium/auxiliary/util/u_inlines.h", line 83: operands have incompatible types: void ":" int Vinson, can you see if commit e75e677d288e67c3c05e7b8744e08cd73bdcbed8 fixes this? (In reply to Brian Paul from comment #4) > Vinson, can you see if commit e75e677d288e67c3c05e7b8744e08cd73bdcbed8 fixes > this? No, it does not fix the build error. 6df72e970c0e2794a5651f7141528baa51c0c491 is the first bad commit commit 6df72e970c0e2794a5651f7141528baa51c0c491 Author: Matt Turner <mattst88@gmail.com> Date: Fri Nov 21 16:33:40 2014 -0800 util: Make u_atomic.h typeless. like how C11's stdatomic.h provides generic functions. GCC's __sync_* builtins already take a variety of types, so that's simple. MSVC and Sun Studio don't, but we can implement it with something that looks a little crazy but is actually quite readable. Thanks to Jose for some MSVC fixes! Reviewed-by: Jose Fonseca <jfonseca@vmware.com> :040000 040000 73eaf29780b62a66a3e97232db35e10156d22638 5724f16275b0fc76ee6f5c1e26e262406738ed4a M src bisect run success Vinson I think Brian's recent 241c599cb109d022ab44aa84ad823ca7a13b32fa commit should have helped with this. (In reply to José Fonseca from comment #7) > > I think Brian's recent 241c599cb109d022ab44aa84ad823ca7a13b32fa commit > should have helped with this. Build is still broken with latest master. mesa: bc18b48924f9acc9999643193ad04694d7baaaeb (master 10.5.0-devel) "../../src/glsl/glsl_parser_extras.cpp", line 1455: Error: Badly formed expression. > Build error with Oracle Studio.
Just realized this is not with MSVC.
Is this still an issue? (In reply to Ian Romanick from comment #10) > Is this still an issue? Yes, this is still an issue. mesa: cba6a4a12943d635e8dd3d38d94e21cbcab8be34 (master 10.6.0-devel) "glsl_parser_extras.cpp", line 1457: Error: Badly formed expression. http://patchwork.freedesktop.org/patch/42582/ fixes this for me when building with Solaris Studio 12.4 compilers. Should be fixed by: commit 4671dca0eecf7dbf3e0d0a13111813756722d57d Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Sun Feb 15 16:19:06 2015 -0800 Use __typeof instead of typeof with Solaris Studio compilers While the C compiler accepts typeof, C++ requires __typeof. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86944 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Cc: "10.5" <mesa-stable@lists.freedesktop.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com> Please reopen if it is still a problem. |
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.