albertodemichelis / squirrel

Official repository for the programming language Squirrel
http://www.squirrel-lang.org
MIT License
895 stars 149 forks source link

silence gcc fallthrough warnings #197

Open fireice-uk opened 4 years ago

fireice-uk commented 4 years ago

Adding this magic comment will stop gcc from crying out on default settings. For more info, see:

-Wimplicit-fallthrough=n section in

https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

NOTE: I assume the four uncommented fallthroughs are intentional - I did not verify code correctness.

zeromus commented 4 years ago

This is gross. you should use attribute((fallthrough)) instead after defining it to something else with a GNUC check.

fireice-uk commented 4 years ago

Indeed, I'm just taking the path of least resistance here. I'm happy to rewrite to whatever attribute system is requested (if we are going to go that route defining one for clang might be pointful).