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 implementation may have extensions (including additional library functions), provided they do not alter the behavior of any strictly conforming program
Given the above I don't think gcc is standard-compliant, even in pedantic mode. Is there a reason for this? Is this intentional or is it a bug?
GCC version 4.9.1.
Edit:
gcc --version
gcc (x86_64-win32-seh-rev1, Built by MinGW-W64 project) 4.9.1

getsis never defined. In non-pedantic mode I getwarning: the `gets' function is dangerous and should not be used.. The second snippet is not an issue, because nothing prevents you from declaring a symbol calledgets. For instance,int printf;is perfectly legal. Am I missing the point of the question?gets-- orfgetsfor that matter. Ifgetsis supported by a given implementation, it's implemented by the library, not by the compiler.<stdio.h>header provided by the GNU C library,getsis still declared, but the declaration is surrounded by#if !defined __USE_ISOC1...#endif. The implementation is still there, but in a way that permits user code to define a function with the same name.