hatkidchan / yaitaa

yummy-yummy ANSI art
GNU General Public License v3.0
8 stars 0 forks source link

Can't build the binary using clang #1

Closed vapronva closed 2 years ago

vapronva commented 2 years ago

Did I Do Everything Right?

Yes, probably? Cloned recursively, then used a plain make command.

Platform With The Issue

M1 Pro on macOS 12.1 with make version 4.3

Make Output on a Mac

cc -Wall -Wextra -Werror -pedantic -std=c99 -ggdb src/mod_blocks.c -Isrc -c -o obj/mod_blocks.o
src/mod_blocks.c:202:11: error: variable 'pal' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
          default: break;
          ^~~~~~~
src/mod_blocks.c:204:39: note: uninitialized use occurs here
        int index_top = closest_color(pal, top),
                                      ^~~
src/mod_blocks.c:196:9: note: variable 'pal' is declared here
        palette_t pal;
        ^
1 error generated.
make: *** [Makefile:19: obj/mod_blocks.o] Error 1

Am I Sure that It's Only on a Mac?

Pretty sure. But IDK why, though. The build completes fine on a regular Linux machine.

hatkidchan commented 2 years ago

Can confirm that issue exists. Problem not in platform, but in compiler. clang is more strict in terms of uninitialized variables, compared to gcc I used to use. You probably can update title to "Can't build the binary using clang". Fix will be pushed in a couple of minutes!

vapronva commented 2 years ago

вставьте плашку "чел не знает си и не долбался с этим". кринж :bing_chilling: