CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Possible bug in compiler v5 on PIC24 - float variables

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Radegast



Joined: 21 Jun 2014
Posts: 1

View user's profile Send private message

Possible bug in compiler v5 on PIC24 - float variables
PostPosted: Sat Jun 21, 2014 1:10 pm     Reply with quote

Test done on PIC24FV32KA302.
This simple code was compiled with the version 4 and it has run on the chip correctly, but same code compiled with version 5 return the value two times and cause malfunction of the microcontroller.
The output was read through serial port.

(putting this code into a function)
-----------
float res;
res=3.5;
printf("%.2f\r",res); // to serial port
--------------

compiled with v4 return -> 3.5
compiled with v5 return -> 3.5
3.5

I have checked also with float variable into a function, the compiler v5 caused that the function is called two times.

Could you confirm it is a bug?
Ttelmah



Joined: 11 Mar 2010
Posts: 19447

View user's profile Send private message

PostPosted: Sun Jun 22, 2014 8:58 am     Reply with quote

Historically, CCS on several compiler versions has had problems with float formats that do not have a field width. So I'm 'not surprised'. It's far safer to specify a width,
vKadal



Joined: 08 Sep 2009
Posts: 7

View user's profile Send private message Send e-mail

PostPosted: Sun Jun 22, 2014 11:24 am     Reply with quote

Kindly report this problem to support@ccsinfo.com. Let them also be aware of this problem
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group