-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Medium
-
SITSW-6383
-
10.01.00
-
12.00.00
-
The below C++ code is not working in an expected way on M4FSS.
The same code works fine on R5FSS.
Please refer below code
#include <stdio.h> #include <string.h> #include <kernel/dpl/DebugP.h> #include "ti_drivers_config.h" #include "ti_drivers_open_close.h" #include "ti_board_open_close.h" typedef unsigned int uint; /// Sample class that sets a string class Foo{ public: Foo(void); static const uint uStrLen = 20U; char mystr[uStrLen + 1U]; }; // class Foo Foo::Foo(void){ strncpy(mystr, "Testing\r\n", uStrLen); mystr[uStrLen] = '\0'; } /// Declare static class instanceFoo foo; void hello_world_main(void *args){ /* Open drivers to open the UART driver for console */ Drivers_open(); Board_driversOpen(); // Foo f; DebugP_log("Hello World!\r\n"); DebugP_log("%s",foo.mystr); // DebugP_log("%s",f.mystr); Board_driversClose(); Drivers_close(); }