Summary: | "nir/nir.h", line 552: Error: Unexpected type name "nir_src" encountered. | ||
---|---|---|---|
Product: | Mesa | Reporter: | Vinson Lee <vlee> |
Component: | Mesa core | Assignee: | mesa-dev |
Status: | RESOLVED WONTFIX | QA Contact: | mesa-dev |
Severity: | normal | ||
Priority: | medium | CC: | alan.coopersmith, jason |
Version: | git | ||
Hardware: | x86 (IA32) | ||
OS: | Solaris | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Vinson Lee
2015-12-01 08:17:30 UTC
The Studio C++ compiler does not support C99 compound literals - when I raised
this to the Studio C++ team they said:
> This:
> (nir_src) { init }
>
> is a C99 feature called "compound literals", which is not part of any C++
> standard. G++ supports it as an extension, Studio C++ does not support it.
>
> C++ code using this feature is non-portable...
I filed Oracle bug 21371509 to request support as an enhancement, but if
you want to build Mesa with Studio now, you'll need to rewrite that code
to use a portable construct instead.
As of commit 51564f04b77e6d29a888a4fbd83d96de062ac634 we now require GCC on Solaris. Though we still might want to avoid non-standard C++ constructs regardless. C++ is not a superset of C99 (though some portions are widely supported), so NIR needs to take care when mixing both things. I guess the question is whether or not this builds with Visual Studio's C++ compiler. If not, maybe we should reopen with changes to the summary? (In reply to Ian Romanick from comment #4) > I guess the question is whether or not this builds with Visual Studio's C++ > compiler. If not, maybe we should reopen with changes to the summary? Afaict MSVC was the first one to use anonymous struct/unions. After all GCC allowed/implemented it as -fms-extensions way before C99 came along. That aside I did explicitly pointed out the lack of portability as this was introduced, yet was greeted by hostility (~ish) and absolutely no support on the topic. Oh well :-\ I had a patch at one point to help C++ out here. I ended up not sending it out because it only fixed warnings that only came up if you had extra warnings turned on. basically it boiled down to #ifdef __cplusplus # define NIR_SRC_INIT nir_src() #else # define NIR_SRC_INIT (nir_src) { { NULL } } #endif And the same thing for NIR_DEST_INIT. Can you try that? |
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.