0

We are trying to use sprintf function in our code but are facing problems.

In certain cases, the program execution goes into Undefined Exception or Reserved Exception.

System Conditions:

Toolchain: GCC for Renesas RX 4.8.4.201902-SP1-GNURX-ELF

MCU: RX1115 – R5F51115ADFN

IDE: e2Studio v7.6.0

Library Settings:

 

The following code Executes properly without any issues. 

char A[50] = {};

sprintf(A,”%s”,”HelloBoyos!!!”);

 

The following code throws an Undefined Exception when executed

char A[50] = {};

sprintf(A,”%s%s”,”Hello”,”Boyos!!!”);

 

The following code, when executed goes to the following non-existent address 

char A[50] = {};

sprintf(A,”%d”,12);

Are we doing something wrong or is this a bug?

 

Any assistance will be really useful and greatly appreciated.

 

Thanks in Advance.

Vikram.

Superberti 回答済