Rodney Dowdall(deleted)
|
RE: Problems with the implementation of the compiler optimization within Momentics 4.7.0 (maybe a bug??)
|
Rodney Dowdall(deleted)
09/13/2012 3:39 PM
post95567
|
RE: Problems with the implementation of the compiler optimization within Momentics 4.7.0 (maybe a bug??)
Hello Daniil
Sometimes the red lines are not coming from the compiler. The C/C++ perspective has a syntax checker that is analyzing
your code. If the paths to compilers, libraries and header files are not set up properly than code that is valid may be
marked as being in error. You can turn this off by going to:
Window->preferences->C/C++->Code Analysis
And choosing what you want to report as a bug and what you don't want to report as a bug.
Thanks,
Rodney
-----Original Message-----
From: Daniil Moerman [mailto:community-noreply@qnx.com]
Sent: Thursday, September 13, 2012 7:41 AM
To: general-ide
Subject: Problems with the implementation of the compiler optimization within Momentics 4.7.0 (maybe a bug??)
I am using the QNX Momentics IDE (4.7.0 on Windows) and encountered the following problem which I assume to be a bug of
the compiler.
When I am writing following in my C file (within a QNX C Project) … static const float SQRT_2 = sqrt(2); static float
SQRT_2_DIV2 = SQRT_2/2.0; (that way I try to avoid unnecessary calculation) … I get following error message from the
compiler, which I see in the “Problems”-View …
initializer element is not constant.
while following line is undelined red ...
static float SQRT_2_DIV2 = SQRT_2/2.0;
Well, on one side I could take this but what I really do not understand is, why the compiler do not detect this “error
” when I compile the same code with a Level 3 optimization? I thought the optimization process is started after parsing
and syntax validation and should not effect the syntax rules.
Would be glad about some help in this situation.
Ahh, and yes, I tried the -Wc,-std=c99 parameter in the compiler settings but what I get are more and more errors which
seems to be absolute pointless because I have a good book in front of me where C99 is used and the compiler start to
tell me that simply everything is false (sounds a bit nonprofessional but I see just red lines).
_______________________________________________
General
http://community.qnx.com/sf/go/post95546
To cancel your subscription to this discussion, please e-mail general-ide-unsubscribe@community.qnx.com
|
|
|