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