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 answered
    • Hi Vikram_FE, we’re looking into your issue and will reply as soon as we have an update.

    • Hello,

      Thank you for reaching out to us!

      Unfortunately, we were unable to reproduce the issue with a basic sample testcase.

      Could you please send us a sample project in which the issue is reproducible in order to investigate? We encourage you to please open a private support ticket where you could attach the project.

      __
      Best regards,
      The GNU Tools Team