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

warning: ignoring return value of function - fgets, fread #57

Open
milahu opened this issue Mar 31, 2023 · 1 comment
Open

warning: ignoring return value of function - fgets, fread #57

milahu opened this issue Mar 31, 2023 · 1 comment

Comments

@milahu
Copy link

milahu commented Mar 31, 2023

just warnings ... still would be nice to have these fixed

clang++ -std=c++11 -Wall -Ofast -march=native src/enwik9-preproc/main.cpp -o enwik9-preproc
In file included from src/enwik9-preproc/main.cpp:39:
src/enwik9-preproc/phda9_preprocess.h:24:5: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
    fgets(s, 8192, sf);
    ^~~~~ ~~~~~~~~~~~
src/enwik9-preproc/phda9_preprocess.h:115:5: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
    fgets(s, 8192, sf);
    ^~~~~ ~~~~~~~~~~~
src/enwik9-preproc/phda9_preprocess.h:203:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
  fread(p1, P3_INPUT_SIZE, 1, sf);
  ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
src/enwik9-preproc/phda9_preprocess.h:246:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
  fread(p1, P4_INPUT_SIZE, 1, sf);
  ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
src/enwik9-preproc/phda9_preprocess.h:294:5: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
    fgets(s, 16384, sf);
    ^~~~~ ~~~~~~~~~~~~
src/enwik9-preproc/phda9_preprocess.h:341:5: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
    fgets(s, 16384, sf);
    ^~~~~ ~~~~~~~~~~~~
src/enwik9-preproc/phda9_preprocess.h:449:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
  fread(p1, TMP1A_SIZE + TMP1B_SIZE, 1, sf);
  ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/enwik9-preproc/phda9_preprocess.h:511:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
  fread(p1, TMP2A_SIZE + TMP2B_SIZE, 1, sf);
  ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/enwik9-preproc/phda9_preprocess.h:589:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
  fread(p1, R3_INPUT_SIZE, 1, sf);
  ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
src/enwik9-preproc/phda9_preprocess.h:633:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
  fread(p1, R4_INPUT_SIZE, 1, sf);
  ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
src/enwik9-preproc/phda9_preprocess.h:680:5: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
    fgets(s, 16384, sf);
    ^~~~~ ~~~~~~~~~~~~
11 warnings generated.
@milahu
Copy link
Author

milahu commented Mar 31, 2023

or better, remove enwik9-preproc from the default build

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