[Mesa-dev] void operation in glsl

Chris Forbes chrisf at ijw.co.nz
Sun Aug 25 23:41:24 PDT 2013


It's just a simple, portable way to make the `unused parameter`
warning shut up, when you're deliberately ignoring your parameters.

There are other ways [__attribute__(( unused )), etc] but they cease
to be simple or portable fairly quickly.

-- Chris

On Mon, Aug 26, 2013 at 5: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?
>
> thanks,
> --lx
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list