Use a compiler that can check printf/scanf calls to make sure the format strings and parameters are consistent.


$ gcc -g -W -Wall -Wextra bar.c
bar.c: In function ‘fill_struct’:
bar.c:34:4:...