fte-team / fteqw

This is the official GitHub mirror for the FTEQW project.
https://www.fteqw.org/
180 stars 54 forks source link

Shadowing static generates warning #134

Closed Xylemon closed 1 year ago

Xylemon commented 1 year ago

https://sourceforge.net/p/fteqw/tickets/92/

paril101 wrote on 2020-07-09:

attempting to shadow a static variable (in a different file, no less) generates a warning about the name being static, even though it's not the same file.

fhomolka commented 1 year ago

This was seemingly fixed, as the compiler will no longer give a shadowing warning for static names that are in different files. Example used first.qc:

static float val = 3;
float() get_val =
{
    return val;
};

second.qc:

static float val = 4;

float() get_second_val =
{
    return val;
};

and a progs.src that defines an empty main and includes both files.

Xylemon commented 1 year ago

Thanks for testing!