为什么gcc在变量名中不显示$的警告消息?

Apo*_*nis 12 c gcc gcc-warning

我是C语言的新手,正在C的第四版编程中学习C。由Stephen Kochan撰写。在第29页上,他写道$变量名称不是有效字符。他正在使用C11标准。

我写了下面的代码

#include <stdio.h>

int main (void)
{
    int a$ = 1;

    printf ("%i", a$);

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

并用命令运行它gcc -std=c11 -pedantic practice.c -o practice.o && ./practice.o。我的文件名是practice.c

输出为1。编译器不应该给我使用警告$吗?$GCC提供的扩展程序不是使用符号作为标识符吗?

我在Ubuntu 18.10中使用GCC 8.2.0。

编辑:

另外,当我使用GCC时不使用GNU扩展-std=c11吗?这就是本书附录(第497页)中写的内容。

我通过使用得到警告-std=c89

nwe*_*hof 11

您会收到警告-std=c89 -pedantic。C99和更高版本允许在标识符中使用其他实现定义的字符