Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile warnings #130

Closed
Yousha opened this issue Feb 19, 2018 · 4 comments
Closed

Compile warnings #130

Yousha opened this issue Feb 19, 2018 · 4 comments

Comments

@Yousha
Copy link
Contributor

Yousha commented Feb 19, 2018

FCNPC/lib/subhook/subhook_x86.c:171:10: warning: variable ‘address_size’ set but not used [-Wunused-but-set-variable] size_t address_size = 4;

FCNPC/src/CRecordManager.cpp: In member function ‘int CRecordManager::Load(char*)’:

FCNPC/src/CRecordManager.cpp:41:41: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] fread(&dwFile, sizeof(DWORD), 1, pFile);

FCNPC/src/CRecordManager.cpp:42:46: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] fread(&iPlaybackType, sizeof(int), 1, pFile);

FCNPC/src/CNode.cpp: In member function ‘bool CNode::Initialize()’:
FCNPC/src/CNode.cpp:56:55: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] fread(&m_nodeHeader, sizeof(CNodeHeader), 1, m_pFile);

FCNPC/src/CNode.cpp:58:51: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] fread(&m_nodePath, sizeof(CPathNode), 1, m_pFile);

FCNPC/src/CNode.cpp: In member function ‘void CNode::SetLink(uint16_t)’:
FCNPC/src/CNode.cpp:179:51: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] fread(&m_nodeLink, sizeof(CLinkNode), 1, m_pFile);

FCNPC/src/CNode.cpp: In member function ‘void CNode::SetPoint(uint16_t)’:
FCNPC/src/CNode.cpp:192:51: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] fread(&m_nodePath, sizeof(CPathNode), 1, m_pFile);

Slackware 14 64bit
cmake 3.5.1
gcc 5.4.0 20160609

Also this project requires CMake 2.8.6 or higher...

@NegativeIQ
Copy link

From a 2 second glance, those variables (pointers) are "global" CNode members, unused reports are false positive in these case. They (files) are opened and kept in memory for other functions (methods) to access them - speed optimization since its way faster to access ram memory then to wait for HDD read.

CMake is defined at 2.8.4, im sure that minor version does not have changes that would affect build (unless there is some bug).
Could you please clarify why 2.8.6 is required (why / what errors you get / or what chagned).

@Yousha
Copy link
Contributor Author

Yousha commented Feb 19, 2018

IK mate, but they shoudn't appear

CMake 2.8.6 or higher is required. You are running version 2.8.4

Got this ^ when I tried to compile it with cMake 2.8.4

@NegativeIQ
Copy link

Well, personally, i would blame CMake since there is cmake_minimum_required (VERSION 2.8.4) line in CMakeLists.txt

Im not expert on CMake, in fact not even advanced user, but i dont see problem in CMakeLists.txt
Dont take my "blame CMake" as an answer and lets wait for someone that has more experience with these stuff.

Also could you please give output from cmake -version (The one that gives error)

By the way @ziggi i think you could just bump minimum version to latest 2.8.x to avoid brainstorming these and still not break anything (it is minor and very outdated version after all...)

ziggi added a commit that referenced this issue Apr 6, 2018
ziggi added a commit that referenced this issue Apr 6, 2018
#130: fix compile warnings
@ziggi
Copy link
Owner

ziggi commented Apr 6, 2018

Everything (instead of first) is are fixed.

FCNPC/lib/subhook/subhook_x86.c:171:10: warning: variable ‘address_size’ set but not used [-Wunused-but-set-variable] size_t address_size = 4;

Discussion about this warning here: Zeex/subhook#25

@ziggi ziggi closed this as completed Apr 6, 2018
ziggi added a commit that referenced this issue Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants