Skip to content

ignoring return value of fread #8

@andreasstieger

Description

@andreasstieger

New werror in 3.0.0:

[   13s] /home/abuild/rpmbuild/BUILD/libbbf-3.0.0-build/libbbf-3.0.0/src/muxer/bbfmux.cpp: In function ‘char* readTxtFile(const char*)’:
[   13s] /home/abuild/rpmbuild/BUILD/libbbf-3.0.0-build/libbbf-3.0.0/src/muxer/bbfmux.cpp:71:10: error: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
[   13s]    71 |     fread(cString, 1, fileSize, file);
[   13s]       |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   13s] cc1plus: all warnings being treated as errors
[   13s] make[2]: *** [CMakeFiles/bbfmux.dir/build.make:82: CMakeFiles/bbfmux.dir/src/muxer/bbfmux.cpp.o] Error 1

In https://github.com/ef1500/libbbf/blob/v3.0.0/src/muxer/bbfmux.cpp#L71 you are not checking the return value,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions