<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED --- - GLSL preprocessor does not support expressions in #line"
href="https://bugs.freedesktop.org/show_bug.cgi?id=72273#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED --- - GLSL preprocessor does not support expressions in #line"
href="https://bugs.freedesktop.org/show_bug.cgi?id=72273">bug 72273</a>
from <span class="vcard"><a class="email" href="mailto:cworth@cworth.org" title="Carl Worth <cworth@cworth.org>"> <span class="fn">Carl Worth</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=72273#c0">comment #0</a>)
<span class="quote">> The GLSL spec says (emphasis mine):
>
> "#line must have, after macro substitution, one of the following forms:
>
> #line line
> #line line source-string-number
>
> where line and source-string-number are constant integer *expressions*."</span >
*Grumble*
That's a deviation from the specification for the preprocessor for C,
where N1256 has two basic forms:
# line digit-sequence newline
# line digit-sequence "s-char-sequence-opt" newline
And a third one specified as follows:
A preprocessing directive of the form
# line pp-tokens new-line
(that does not match one of the two previous forms) is permitted. The
preprocessing tokens after line on the directive are processed just as
in normal text (each identifier currently defined as a macro name is
replaced by its replacement list of preprocessing tokens). The directive
resulting after all replacements shall match one of the two previous forms
and is then processed as appropriate.
In other words, in C, you can have macro-substitution here, but in the end
you have to have digits and nothing but digits for the line number, (which
is basically what we currently have implemented in Mesa).
Anyway, like I said, it's not hard to change. But I wonder if this deviation
is a GLSL specification bug or is actually intended.
Ian, what prompted the bug report? Are there known shaders in the wild
putting parentheses in #line directives or something?
-Carl</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>