小编mah*_*n.b的帖子

模拟编译错误

昨天我试图在我的工作树中注入编译错误.通常我使用#error来生成编译错误.但我尝试了#1,但它不起作用.这可能是什么原因?

t1.c 
     #include <stdio.h>
     int main (){
            #error
     }

**compilation error**
t1.c:3:3: error: 
        #error
t2.c
    #include <stdio.h>
    int main (){
        #1
    }

But there is no compilation error in t2.c
Run Code Online (Sandbox Code Playgroud)

c c-preprocessor

1
推荐指数
1
解决办法
52
查看次数

标签 统计

c ×1

c-preprocessor ×1