为什么没有注释的url(http://)可以编译而不会出错?

Gst*_*tso -2 c

我发现我在源代码中添加了一些URL,但忘了评论它,但仍然可以编译,我单独测试它:

int main(){
    http://localhost
    return 0;
}

gcc hello.c -o hello.exe
Run Code Online (Sandbox Code Playgroud)

哪个仍然可以编译没有错误,我检查c关键字,'http'似乎不是关键字,是什么原因?

mas*_*ash 9

因为它将被视为标签,然后是评论.

所以你以后可以:

goto http;
Run Code Online (Sandbox Code Playgroud)

如果你打开警告:-Wall它会优雅警告你:

 In function ‘main’:
:2:5: warning: label ‘http’ defined but not used [-Wunused-label]
     http://localhost
Run Code Online (Sandbox Code Playgroud)