G++
GCCとG++でのswitch文内のcaseラベルにおけるconst定数の扱いの違い #include <stdio.h> int main(void) { const int A = 2; int a = 2; switch(a) { case A: puts("ok"); break; } } $ gcc test.c test.c: In function ‘main’: test.c:10: error: case ラベルを整数</stdio.h>…
GCCとG++でのswitch文内のcaseラベルにおけるconst定数の扱いの違い #include <stdio.h> int main(void) { const int A = 2; int a = 2; switch(a) { case A: puts("ok"); break; } } $ gcc test.c test.c: In function ‘main’: test.c:10: error: case ラベルを整数</stdio.h>…