How to compile without warnings being treated as errors?

前端 未结 7 2200
迷失自我
迷失自我 2020-12-07 14:27

The problem is that the same code that compiles well on Windows, is unable to compile on Ubuntu. Every time I get this error:

cc1: warnings being treated as          


        
7条回答
  •  情书的邮戳
    2020-12-07 14:55

    If you are compiling linux kernel. For example, if you want to disable the warning that is "unused-but-set-variable" been treated as error. You can add a statement:

    KBUILD_CFLAGS += $(call cc-option,-Wno-error=unused-but-set-variable,)
    

    in your Makefile

提交回复
热议问题