#include <stdio.h>
int main() {
printf("Enter your name\n");
char name[99];
scanf("%d", name);
printf("Hello %s\n", name);
}
While executing this simple program I mistakenly used %d instead of %s. But when I compiled the code using gcc, it didn't display any warnings. It simply created an output file.
$ gcc greet.c
$ ls
greet.c a.out
$
Whereas compiling this code with clang does display warnings. I am quite certain that gcc should have displayed warnings just like clang did without passing any arguments.
I recently switched from Ubuntu to Debian and I don't know if this is due to some missing dependency.
Some additional information
GCC version : gcc (Debian 8.3.0-6) 8.3.0
OS : Debian 10(Buster)