Deciphering a queer compiler warning about unsigned decimal constant
Posted
by Artagnon
on Stack Overflow
See other posts from Stack Overflow
or by Artagnon
Published on 2010-05-24T17:54:08Z
Indexed on
2010/05/24
18:01 UTC
Read the original article
Hit count: 255
c
|compiler-warnings
This large application has a memory pool library which uses a treap internally to store nodes of memory. The treap is implemented using cpp macros, and the complete file trp.h can be found here. I get the following compiler warning when I attempt to compile the application:
warning: this decimal constant is unsigned only in ISO C90
By deleting portions of the macro code and using trial-and-error, I finally found the culprit:
#define trp_prio_get(a_type, a_field, a_node) \
(2654435761*(uint32_t)(uintptr_t)(a_node))
I'm not sure what that strange number is doing there, but I assume it's there for a good reason, so I just want to leave it alone. I do want to fix the warning though- any idea why the compiler's saying that it's unsigned only in ISO C90?
EDIT: I'm using gcc-4.1
© Stack Overflow or respective owner