|
|
|
Re: Eclipse indexing wrongly [message #1022837 is a reply to message #1022322] |
Fri, 22 March 2013 16:05 |
Klaus km Messages: 142 Registered: November 2011 |
Senior Member |
|
|
Hello David,
you probably know that Eclipse and CDT are written in Java?
The biggest integer Data Type in Java is long, which is a 64 Bit SIGNED type. This is the reason, why the Editor grayed out the 'if' wrongly, because CDT internally is using "long".
Try out this example, it's using the biggest number, which CDT (and Java) could save in a primitive Data Type "long". In this example checkpoint2 is not grayed out:
#include <stdio.h>
#include <limits.h>
#define TEST_MAX 0x7fffffffffffffffUL
int main() {
printf("%llu\n", (unsigned long long) TEST_MAX);
#if TEST_MAX == 0xffffffffUL +1
printf("checkpoint1\n");
#elif (TEST_MAX >> 62) == 1
printf("checkpoint2\n");
#else
printf("checkpoint3\n");
#endif
return 0;
}
Could you please check Bugzilla, maybe there is already a Bug-Entry about this problem, but if not please add a new bug.
Bugzilla: https://bugs.eclipse.org/bugs/
Java-Data Types: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
regards,
Klaus
CDT User Guide
CDT User FAQ
|
|
|
Re: Eclipse indexing wrongly [message #1022869 is a reply to message #1022837] |
Fri, 22 March 2013 17:20 |
David W Messages: 16 Registered: March 2013 |
Junior Member |
|
|
Hi Klaus
Thanks. I don't see an existing bug so I created one last week, ID 403404.
I used your example and yes the checkpoint2 is NOT grayed out.
My case is not as simple as printing out "checkpoinsts". I actually have some typedef within each if condition. Wrongly grayed out means the typedef declaration within the if statement will NOT be known and so the indexing throughout the whole program fails.
Is there a quick fix that we can do to avoid this situation?
Thanks
David
[Updated on: Fri, 22 March 2013 17:21] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04224 seconds