Why can I use gets() in gcc -std=c11?
问题 The gets() function has been removed from the C language. No such function exists in the standard. Yet I compile the following code: #include <stdio.h> int main (void) { (void) gets (NULL); } using gcc -std=c11 -pedantic-errors -Wall -Wextra and it compiles without giving any errors or warnings. Similarly, #include <stdio.h> int gets; int main (void) {} will not compile (error: 'gets' redeclared as different kind of symbol). In the standard 4. Conformance §6 we can read: A conforming