[Mesa-dev] void operation in glsl

Matt Turner mattst88 at gmail.com
Sun Aug 25 23:42:22 PDT 2013


On Sun, Aug 25, 2013 at 10:07 PM, Liu Xin <liuxin at icubecorp.com> wrote:
> HI, list,
>
> i don't understand why glsl source  have  so many 'cast to void' operations,
> like this.
>
> ir_rvalue *
> ast_node::hir(exec_list *instructions,
>           struct _mesa_glsl_parse_state *state)
> {
>    (void) instructions;
>    (void) state;
>
>    return NULL;
> }
>
> i think it's totally void operation, do you guy just make gcc compiler
> happy?

Yes, the purpose is only to avoid unused variable warnings emitted by
the compiler.


More information about the mesa-dev mailing list