BUG MIKROC FOR PIC 8 BIT

mikroC, mikroBasic and mikroPascal PRO for Microchip’s 8-bit PIC MCUs.
Post Reply
Author
Message
umbertomori
Posts: 45
Joined: 06 Feb 2018 11:48
Contact:

BUG MIKROC FOR PIC 8 BIT

#1 Post by umbertomori » 09 Nov 2018 16:29

I HAVE FOUND THIS BUG!
IS READY SOLUTIONS???


EXAMPLE:

char TIME=23 ===> it is 8 bit number example=23 decimal

char Buffer[10] ===> it is an buffer of 10 byte, 10 byte of 8 bit….

sprintf(Buffer,"%02u",TIME);




The result must be:

Buffer[0]=0x32 (first number of the 23 in character)
Buffer[1]=0x33 (second number of 23 in character)

The sprintf conversion (for example) my decimal value 23 (1 byte) in to 2 byte... in to 2 character !!!

All compilers (microchip,ccs,gcc,iar,ecc) are so rational. It's a C-language standard.

Time is char ok and this is correct, Buffer is an array of char….. , so why the variable TIME must be of 16 bit? this is an BIG BIG BUG OF THIS COMPILER!!!!!!!!!!!!!!!!!!!

Umberto

Umberto Italy

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: BUG MIKROC FOR PIC 8 BIT

#2 Post by filip » 13 Nov 2018 09:42

Hi,

I believe the my colleague Peter has answered you how to use sprintf properly with the mikroC compiler.

I will pass your suggestion to our developers.

Regards,
Filip.

Post Reply

Return to “PIC PRO Compilers”