c++ - Convert Warning to Error -
c++ - Convert Warning to Error -
in windows, vc++ has nifty alternative /we convert specific warning error. every warning emitted vc++ has warning number illustration
warning c4265: 'cfoo' : class has virtual functions, destructor not virtual
so easy identify number , add together compiler alternative using /we switch /we4265
i checked g++ documentation , found similar (i believe), -werror=, documentation mentions
make specified warning error.
but question is,
given compiler warning
/yada/yada/src/inc/module.h:580: warning: 'struct ifoo' has virtual functions non-virtual destructor
how convert error using -werror
compiler option?
that sentence in manual continues, answer:
the specifier warning appended; illustration -werror=switch
turns warnings controlled -wswitch
errors. switch takes negative form, used negate -werror
specific warnings; illustration -wno-error=switch
makes -wswitch
warnings not errors, when -werror
in effect.
i'm not 100% sure, -wdelete-non-virtual-dtor
might warning in question, you'd need -werror=delete-non-virtual-dtor
.
c++ c visual-c++ gcc
Comments
Post a Comment