我经常听到,在编译C和C ++程序时,我应该“始终启用编译器警告”。为什么这是必要的?我怎么做?
有时我也听说我应该“将警告视为错误”。我是不是该?我怎么做?
c c++ warnings c++-faq compiler-warnings
#include <stdio.h> int main() { const int a = 12; int *p; p = &a; *p = 70; }
它会起作用吗?
c const undefined-behavior
c ×2
c++ ×1
c++-faq ×1
compiler-warnings ×1
const ×1
undefined-behavior ×1
warnings ×1