Skip navigation.
Home
The QNX Community Portal

View topic - Suggested compiler warnings when working with doubles

Suggested compiler warnings when working with doubles

For discussion of realtime and/or embedded programming.

Suggested compiler warnings when working with doubles

Postby queBurro » Wed Jul 13, 2011 10:29 am

can anyone give me any compiler warnings that might help when dealing with a mixture of doubles and floats?

currently I'm using "-w9 -Wall -Wpointer-arith -Wno-shadow -Wwrite-strings -pedantic"
I ditched -W (-Wextra?), due to false +ves I was getting in a QNX source.

also can anyone tell me what the qnx compiler version of the following are:
-Wunsuffixed-float-constants
-Wfloat-equal
-Wdouble-promotion
(via http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html)

Cheers
queBurro
Active Member
 
Posts: 79
Joined: Fri Jul 30, 2010 2:05 pm

RE: Suggested compiler warnings when working with doubles

Postby mario » Wed Jul 13, 2011 12:59 pm

QNX uses gcc so these option should be supported, however the doc you pointed to are for the latest release of GCC. The version of gcc use in your version of QNX (you didn't say which one you use) may not support these options.

For x86 the double-promotion doesn't really apply as double are handled in hardware.

I just tried -Wfloat-equal with QNX 6.5.0 ( gcc4.4.2) and it works fine.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: Suggested compiler warnings when working with doubles

Postby queBurro » Wed Jul 13, 2011 1:40 pm

Cheers! I was using gcc2.95.3 (Qnx632), but I've just spotted I can move that up to gcc3.3.5 which does support -Wfloat-equal.
queBurro
Active Member
 
Posts: 79
Joined: Fri Jul 30, 2010 2:05 pm

RE: Suggested compiler warnings when working with doubles

Postby Thunderblade » Thu Jul 14, 2011 9:43 am

Go to 6.4 if you can, better compiler, better performance, better network stack...
Thunderblade
Senior Member
 
Posts: 487
Joined: Thu Apr 07, 2005 11:52 am

RE: Suggested compiler warnings when working with doubles

Postby queBurro » Thu Jul 14, 2011 11:04 am

if we upgrade it would prob be to 6.5 and then we'd get hit with a hefty bill.
queBurro
Active Member
 
Posts: 79
Joined: Fri Jul 30, 2010 2:05 pm

RE: Suggested compiler warnings when working with doubles

Postby Thunderblade » Thu Jul 14, 2011 12:19 pm

Do you mean you do not have a maintenance & support contract with QNX?! If you have, upgrading is free. If you don't have, and are actively working on a QNX project..... ehm... I'm out.
Thunderblade
Senior Member
 
Posts: 487
Joined: Thu Apr 07, 2005 11:52 am

RE: Suggested compiler warnings when working with doubles

Postby queBurro » Thu Jul 14, 2011 12:26 pm

I do mean that, (QNX are aware) AFAIK when we stopped paying the support free we lost upgrades and support but we're still licensed to develop using our existing momentics setup.
queBurro
Active Member
 
Posts: 79
Joined: Fri Jul 30, 2010 2:05 pm


Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 4 guests