$ cat test.c
#include<stdio.h>
#include<cs50.h>
#include<string.h>
int main (void)
{ string s = get_string();
if (s != NULL);
{
for (int i= 0; i <strlen(s); i++);
{
printf ("%c\n", s[i]) ;
}
}
}
$ make test
clang -fsanitize=integer -fsanitize=undefined -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wshadow test.c -lcrypt -lcs50 -lm -o test
test.c:12:18: error: format specifies type 'int' but the argument has type '<dependent type>' [-Werror,-Wformat]
printf ("%c\n", s[i]) ;
~~ ^~~~
test.c:12:20: error: use of undeclared identifier 'i'
printf ("%c\n", s[i]) ;
^
test.c:9:35: error: for loop has empty body [-Werror,-Wempty-body]
for (int i= 0; i <strlen(s); i++);
^
test.c:9:35: note: put the semicolon on a separate line to silence this warning
3 errors generated.
make: *** [test] Error 1