Mesa (9.2): glsl: Don' t emit empty declaration warning for a struct specifier

Carl Worth cworth at kemper.freedesktop.org
Fri Dec 13 04:20:45 UTC 2013


Module: Mesa
Branch: 9.2
Commit: a15aa108ea637550741b13b7c74248a99b53237e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a15aa108ea637550741b13b7c74248a99b53237e

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Wed Nov 27 11:22:27 2013 -0800

glsl: Don't emit empty declaration warning for a struct specifier

The intention is that things like

   int;

will generate a warning.  However, we were also accidentally emitting
the same warning for things like

  struct Foo { int x; };

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68838
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: Aras Pranckevicius <aras at unity3d.com>
Cc: "9.2 10.0" <mesa-stable at lists.freedesktop.org>
(cherry picked from commit 758658850bd5ba64bf2e8c04516ea1292aedcfc3)

---

 src/glsl/ast_to_hir.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 0481b1f..b06a081 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2682,7 +2682,7 @@ ast_declarator_list::hir(exec_list *instructions,
                                precision_names[this->type->qualifier.precision],
                                type_name);
          }
-      } else {
+      } else if (this->type->specifier->structure == NULL) {
          _mesa_glsl_warning(&loc, state, "empty declaration");
       }
    }




More information about the mesa-commit mailing list