On 06/10/2014 10:20 PM, Ian Romanick wrote:
I did a little more research.  Looking at the commit history, it must
just be an MSVC thing:

commit 78d3cfb5b4fe1dbe052f87458e62cc2be2ecf171
Author: Brian Paul <bri...@vmware.com>
Date:   Sun Nov 4 16:43:44 2012 -0700

     glsl: remove incorrect 'struct' keyword

     ir_variable is a class, not a struct.  Fixes an MSVC warning.

     Reviewed-by: Jose Fonseca <jfons...@vmware.com>

So, I think it is just class vs struct (and not struct vs nothing) that
causes the warning.



Mixing class and struct is fine in the Itanium ABI (the ABI used by gcc on Linux), they're both mangled the same. On Windows, the mangling is different and mixing class and struct will actually cause problems. Usually the problem is a failure to link.

For the kicks of it, clang++ has -Wmismatched-tags (part of -Wall) that will warn about mixing.

(As far as the C++ standard is concerned, `struct' class-key, `class' class-key and `union' class-key create "classes")

In a nutshell, for Windows builds, struct and class must match. For testing on Linux, CXX=clang++ CXXFLAGS=-Werror=mismatched-tags.

--
Petri Latvala

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to