LIJI32 / GBVideoPlayer2

A new version of GBVideoPlayer with higher resolution, 3-bit stereo PCM audio and video compression
MIT License
96 stars 15 forks source link

Compiler error with gcc #3

Open frestr opened 5 years ago

frestr commented 5 years ago

Hi. Thanks for this amazing software!

When I try to compile it with gcc (8.3.0), I get the following error:

encoder.c: In function ‘main’:                                                                           
encoder.c:454:9: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
         fread(rgb, sizeof(rgb), 1, in);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors                                                                

As the warning says, the return value of fread is being ignored, and turns into an error because of the -Werror flag.

A simple fix is of course to remove that flag. I tried to add a simple return check for it in encoder.c, but for some reason that check always fails at the first frame. Apparently the code works without it though, so I'm hesitant to change anything there.