Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler error with gcc #3

Open
frestr opened this issue Nov 2, 2019 · 0 comments
Open

Compiler error with gcc #3

frestr opened this issue Nov 2, 2019 · 0 comments

Comments

@frestr
Copy link

frestr commented Nov 2, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant