rui314 / 9cc

A Small C Compiler
MIT License
1.83k stars 155 forks source link

Fix compiler formater arguments warnings #19

Closed quantumsheep closed 2 years ago

quantumsheep commented 5 years ago

Fixing those warnings from GCC (gcc version 8.2.0 (Ubuntu 8.2.0-7ubuntu1)):

token.c: In function ‘warn_token’:
token.c:96:3: warning: format not a string literal and no format arguments [-Wformat-security]
   fprintf(stderr, msg);
   ^~~~~~~
token.c: In function ‘bad_position’:
token.c:107:3: warning: format not a string literal and no format arguments [-Wformat-security]
   error(msg);
   ^~~~~