Is it possible to display compiler warnings in Arduino?

前端 未结 5 676
伪装坚强ぢ
伪装坚强ぢ 2021-01-07 01:28

I would like the Arduino IDE to display compiler warnings, and I would rather not have to compile once in the terminal for warnings, and again through Arduino to generate th

5条回答
  •  抹茶落季
    2021-01-07 01:51

    The default compiler command line options include -w, which suppresses warnings, but you can change that by editing C:\Program Files (x86)\Arduino\hardware\arduino\avr\platform.txt. Since the libraries might contain warnings, but I want -Werror for myself, I removed the -w options, and then added to my source code:

    #pragma GCC diagnostic error "-Wall"
    #pragma GCC diagnostic error "-Werror"
    

提交回复
热议问题