Andres Freund <[email protected]> writes:
> One of the recent commits have introduce a new warning with gcc 10, when
> building with optimizations:
> In file included from
> /home/andres/src/postgresql/src/backend/regex/regcomp.c:2304:
> /home/andres/src/postgresql/src/backend/regex/regc_nfa.c: In function
> ‘checkmatchall’:
> /home/andres/src/postgresql/src/backend/regex/regc_nfa.c:3087:20: warning:
> array subscript -1 is outside array bounds of ‘_Bool[257]’ [-Warray-bounds]
> 3087 | hasmatch[depth] = true;
> | ^
Hmph. There's an "assert(depth >= 0)" immediately in front of that,
so I'm not looking too kindly on the compiler thinking it's smarter
than I am. Do you have a suggestion on how to shut it up?
regards, tom lane