Compilers do check code branches even they're inactive due to compile-time constants.

ICPC seems to be the only that checks the array bounds, but you could possibly run into other annoying warnings, like from Visual C++, which warns about constant conditional expressions when checking N (C4127 with warning level 4).

I definitely would take care of the warning, your mileage may vary:

disable warning with compiler option -wd175

disable warning at this specific point with vendor-dependent #pragma warning(disable: 175)