While this doesn't solve the issue of needing a "-Wno-warn-unused-result", or the lack of warnings on fprintf, it may help to disable the pre-processor option causing the warnings to be used (-D_FORTIFY_SOURCE=2). If you want to risk losing the other compile-time and run-time protections, you can use -U_FORTIFY_SOURCE
While this doesn't solve the issue of needing a "-Wno-warn- unused- result" , or the lack of warnings on fprintf, it may help to disable the pre-processor option causing the warnings to be used (-D_FORTIFY_ SOURCE= 2). If you want to risk losing the other compile-time and run-time protections, you can use -U_FORTIFY_SOURCE
For more details, see https:/ /wiki.ubuntu. com/CompilerFla gs