Menu

#17 3.4 warning: ignoring return value of 'fgets', declared with attribute warn_unused_result (gcc 4.7.2)

v1.0_(example)
closed
bofh28
None
1
2014-04-27
2012-10-27
Jari Aalto
No

Cranking up the security during compiling (gcc 4.7.2) causes following warnings:

/usr/bin/gcc -D_FORTIFY_SOURCE=2 -pthread -Wall -pedantic -std=c99 -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security crunch.c -lm -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o crunch

crunch.c: In function 'renamefile':
crunch.c:1406:12: warning: variable 'pidret' set but not used [-Wunused-but-set-variable]
crunch.c: In function 'main':
crunch.c:2953:10: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
crunch.c: In function 'resumesession':
crunch.c:2178:7: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
crunch.c: In function 'renamefile':
crunch.c:1460:7: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
crunch.c:1463:9: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]

Discussion

  • bofh28

    bofh28 - 2012-10-27

    I know about the pidret issue. I will look at the others. Thank you for the report.

     
  • bofh28

    bofh28 - 2012-10-27
    • assigned_to: bofh28
     
  • bofh28

    bofh28 - 2014-04-27

    This should be fixed in version 3.5. If it is not please let me know.

     
  • bofh28

    bofh28 - 2014-04-27
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB