Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

Warnings treated as errors

Hi,

I am trying to build a library of my own. But I am getting errors which are in fact warnings but treated as errors. I have removed -Werror from every possible make file but still getting the same error [-Werror=unused-parameter]. Does anybody know how to disable it completely from mos build command or from mos.yml or somewhere else?

/Ibrahim

Comments

  • SergeySergey Dublin, Ireland

    Please fix the warnings instead!

    Thanked by 1ibrahimdanish
  • ibrahimdanishibrahimdanish Gothenburg

    do you @Sergey mean to say its not possible to suppress warnings treated as errors?

  • @ibrahimdanish , yes, at the moment it's not supported. We believe that ignoring warnings is a call for trouble, so -Werror does help to avoid bugs.

  • @Sergy, @dimonomid - I just ran into this issue when trying to compile code for an ESP8266. I had previously compiled the same code for the ESP32. When I say the same, I mean that the lines of code (functions) causing the problem were identical between programs. When compiling for the ESP32 I would notice the warnings as errors - in this case, unused variables, but as soon as I fixed the "real" error, I no longer received messages about warnings being treated as errors concerning unused variables.

    In my case, the issue is that many callback functions have a signature that includes void *arg as the last argument in the function call. When not using the arg variable, on the ESP32, the code would compile. On the ESP8266 the code would not compile until I inserted bogus uses of the arg variable. Perhaps I am missing something, but I was unsuccessful in using the functions without the void *arg variable. If I have missed something, please tell me how to avoid this issue. If I haven't missed something, it would be helpful not to have to make up a solution to get rid of the error. It would also be helpful if compiling for the ESP32 and the ESP8266 behaved in a similar fashion.

Sign In or Register to comment.