Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Macro redefinition warning of "UINT_MAX" #34

Closed
danielecesarini opened this issue Jan 18, 2019 · 3 comments
Closed

Macro redefinition warning of "UINT_MAX" #34

danielecesarini opened this issue Jan 18, 2019 · 3 comments

Comments

@danielecesarini
Copy link
Contributor

In "msr_rapl.h" there is the macro definition:

#define UINT_MAX 4294967295U

The macro definition is taken from "limits.h" (as the comment say) but if I need to use "limits.h" (or a library which include "limits.h", as instance HWLOC library) this macro consequently raises a warning because the compiler discover a macro redefinition.

@danielecesarini
Copy link
Contributor Author

danielecesarini commented Jan 20, 2019

In file included from /home/workspace/myproject/include_file.h(57), from /home/workspace/myproject/file.c(34): /home/workspace/libmsr/include/msr_rapl.h(110): warning #47: incompatible redefinition of macro "UINT_MAX" (declared at line 97 of "/opt/intel/pe-xe-2017/binary/compilers_and_libraries_2017.4.196/linux/compiler/include/limits.h") #define UINT_MAX 4294967295U // taken from limits.h

@slabasan
Copy link
Collaborator

Thanks @danielecesarini! I haven't had a chance to test this, but if we were to remove the UINT_MAX macro and instead include limits.h, would this resolve the issue?

@danielecesarini
Copy link
Contributor Author

Yes, it works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants