view lwcc/token_names.c @ 508:10f62dc61a75

Fix bad usage of sprintf() Usage of sprintf() to append to a string in the form of sprintf(buf, "%s...", buf...) is undefined, regardless whether it worked on a lot of older systems. It was always a bad idea and it now breaks on current glibc and gcc development environments. The moral: if any of your code uses sprintf() in a way similar to the above, fix it. It may not fail in a benign way.
author William Astle <lost@l-w.ca>
date Sun, 10 May 2020 22:38:24 -0600
parents a3e277c58df9
children
line wrap: on
line source

char *ptoken_names[] = {
"TOKEN_NONE",
"PTOK_ENDS",
"PTOK_IDENTIFIER",
"PTOK_STAR",
"PTOK_KW_VOID",
"PTOK_KW_FLOAT",
"PTOK_KW_DOUBLE",
"PTOK_KW_LONG",
"PTOK_KW_UNSIGNED",
"PTOK_KW_SIGNED",
"PTOK_KW_INT",
"PTOK_KW_SHORT",
"PTOK_KW_CHAR",
"PTOK_OPAREN",
"PTOK_CPAREN",
"PTOK_OBRACE",
"PTOK_CBRACE",
"" };