warning: ignoring return value of function - fgets, fread
milahu opened this issue · 1 comments
milahu commented
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 commented
or better, remove enwik9-preproc
from the default build