https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66875
--- Comment #3 from Patrick S. <patricksung at gmail dot com> --- argh... my mistake to not check the termination condition is actually matching the size of the prot_short_str[] array. fixing that by properly calculating the array size would fix the compilation now. Thanks! But one more thing. Since the compiler can see the static size of the array, wouldn't it be possible to have a warning for possible access of array size out of bound?