erkkah / tigr

TIGR - the TIny GRaphics library for Windows, macOS, Linux, iOS and Android.
Other
745 stars 44 forks source link

Variable Shadowing Issue in tigr.c #61

Open AdreKiseque opened 3 months ago

AdreKiseque commented 3 months ago

(Apologies if I'm missing something obvious, I'm a novice)

Trying to learn TIGR so I started by building the hello example in my space. But on running make hello I get the following error:

tigr/tigr.c:1820:19: error: declaration shadows a local variable [-Werror,-Wshadow]
        TigrGlyph g = font->glyphs[i];
                  ^
tigr/tigr.c:1730:16: note: previous declaration is here
    TigrGlyph* g;
               ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 errors generated.
make: *** [Makefile:13: hello] Error 1

Straightforward error, I imagine it's caused by a compiler difference (I'm using Clang). Probably easy to fix.

AdreKiseque commented 3 months ago

Looks like there are multiple instances of this variable shadowing issue. Very disturbing.