https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79082
Sylvestre Ledru <sylvestre at debian dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sylvestre at debian dot org
--- Comment #11 from Sylvestre Ledru <sylvestre at debian dot org> ---
Other testcase:
---
#include <stdio.h>
#include <stdint.h>
int main() {
char* buf = new char[10];
uint8_t data = 255;
printf("%.2x\n", data); // just print data
snprintf(&buf[0], 2, "%.2x", data);
return 0;
}
---
foo.c:7:13: note: format output 3 bytes into a destination of size 2
snprintf(&buf[0], 2, "%.2x", data);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
---