MegaGlest Forum

Archives (read only) => Glest Advanced Engine => Bug reports => Topic started by: tomreyn on 9 January 2012, 07:17:20

Title: e3257cf: Build warnings
Post by: tomreyn on 9 January 2012, 07:17:20
Hi,

after a long break, I finally had another look at GAE. While building e3257cf6375580745f9bc365bd842544f8907852 (on amd64), these (possibly intended and probably non-problematic) warnings showed up:

Code: [Select]
[ 34%] Building CXX object source/g3d_viewer/CMakeFiles/gae_g3dviewer.dir/renderer.cpp.o
/home/tomreyn/SCM/glestae/source/map_editor/map.cpp: In member function ‘void MapEditor::Map::loadFromFile(const string&)’:
/home/tomreyn/SCM/glestae/source/map_editor/map.cpp:579:47: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
/home/tomreyn/SCM/glestae/source/map_editor/map.cpp:590:53: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
/home/tomreyn/SCM/glestae/source/map_editor/map.cpp:591:53: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
/home/tomreyn/SCM/glestae/source/map_editor/map.cpp:598:53: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
/home/tomreyn/SCM/glestae/source/map_editor/map.cpp:605:53: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
/home/tomreyn/SCM/glestae/source/map_editor/map.cpp:613:37: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
[ 35%] Building CXX object source/map_editor/CMakeFiles/gae_mapeditor.dir/program.cpp.o
Title: Re: e3257cf: Build warnings
Post by: Yggdrasil on 11 January 2012, 15:11:21
Yeah, one can say that they are "intended". It'll probably never happen that it reads less than it was told to read (size is small enough). So the return value is useless. One could still silence the warning though or really fix it...