snprintf compile error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hi!
I was just playing around with snprintf because I read an advice that it is generally safer to use in applications because of the possible size limitation and avoiding writing out of buffer.
So I tried to compile an adapted example from here: http://
(for later usage in my oled part like here: https:/
This: (taken from cplusplus.com example)
..
char line[100];
snprintf (line, sizeof(line), "The half of %d is %d", 60, 60/2 );
..
Produced:
/../../
sbrkr.c:
Example from my github https:/
this works of course: ... else sprintf(line, "SAT : - FIX : - ");
this ALSO works: ... else snprintf(line, sizeof(line), "SAT : - FIX : - ");
But this doesn't work (same error in the fist line):
if (FEATURE_GPS) snprintf(line, sizeof(line), "SAT : %d FIX : %d ", GPS_satnum, GPS_fix); // snprintf doesn't work here
else snprintf(line, sizeof(line), "SAT : - FIX : - ");
I am compiling for cortex-m3 using gcc-arm-
Cheers Rob
Changed in gcc-arm-embedded: | |
status: | New → Invalid |
Hi,
Could you provide the command you use to compile and link the example?
BR,
Tony