Bug 68838 - GLSL: struct declarations produce a "empty declaration warning" in 9.2
GLSL: struct declarations produce a "empty declaration warning" in 9.2
Product: Mesa
Classification: Unclassified
Component: glsl-compiler
All All
: medium normal
Assigned To: Ian Romanick
Depends on:
  Show dependency treegraph
Reported: 2013-09-02 09:38 UTC by Aras Pranckevicius
Modified: 2013-12-06 16:43 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Note You need to log in before you can comment on or make changes to this bug.
Description Aras Pranckevicius 2013-09-02 09:38:07 UTC
All GLSL struct declarations seem to produce "warning: empty declaration" warning. For example:

struct Foo { float a; };
void main() { gl_FragColor = vec4(0.0); }

Otherwise the compilation succeeds, so not a critical issue. If I modify glsl2 to output shader info log even when it did compile successfully, then the warning is printed.

Reproduces with mesa master (f7217b99f2437), 9.2 (9586f4de7). Works correctly in 9.1 (0dbbfa054c9).
Comment 1 Ian Romanick 2013-09-02 22:00:47 UTC
Yeah, I noticed that too. :(  It should be any easy fix.  I try to get a patch out this week.
Comment 2 Ian Romanick 2013-12-06 16:43:10 UTC
Fix by the following commit.  This will get cherry picked to the 10.0.1 release.

commit 758658850bd5ba64bf2e8c04516ea1292aedcfc3
Author: Ian Romanick <ian.d.romanick@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
    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@intel.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68838
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    Cc: Aras Pranckevicius <aras@unity3d.com>
    Cc: "9.2 10.0" <mesa-stable@lists.freedesktop.org>