Hacker News new | past | comments | ask | show | jobs | submit login

-Weverything if using clang



It's too noisy just by itself. First time I tried it, it complained about padding added to structures. When I packed them, it complained about packed structures.


Manually pad them, and it'll complain about unused fields ;)

I've actually had some pieces of code where it was super useful to enable that padding warning as an error. Some complicated C++ types that needed to have identical memory layouts across compilers yet often weren't because of some really nasty shenanigans...

-Weverything is for people who really want to explicitly opt out of every warning they don't like.


Not recommended. Particularly there are warnings for C++ now that are "mutually unsatisfy-able."


it's much better to start from -Weverything and add -Wno-whatever (e.g. -Wno-c++11-compat for instance which complains about C++11 features) than start from -Wall -Wextra etc...


Any examples?




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: