mirror of git://sourceware.org/git/glibc.git
posix: Suppress -Os warnings on fnmatch
GCC with -Os issues some may uninitialized warnings on fnmatch code. All of the variables are already set when they are accessed on the loop prior. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
parent
c651f9da53
commit
9ec1c8cd24
|
|
@ -530,6 +530,14 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
|
||||||
{
|
{
|
||||||
/* Compare the byte sequence but only if
|
/* Compare the byte sequence but only if
|
||||||
this is not part of a range. */
|
this is not part of a range. */
|
||||||
|
|
||||||
|
/* The compiler might warn that idx may be
|
||||||
|
used uninitialized, however it will be
|
||||||
|
reached iff elem < table_size which means
|
||||||
|
that it was properly set in the loop
|
||||||
|
above. */
|
||||||
|
DIAG_PUSH_NEEDS_COMMENT;
|
||||||
|
DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
|
||||||
if (! is_range
|
if (! is_range
|
||||||
|
|
||||||
# if WIDE_CHAR_VERSION
|
# if WIDE_CHAR_VERSION
|
||||||
|
|
@ -542,11 +550,19 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
|
||||||
n += c1 - 1;
|
n += c1 - 1;
|
||||||
goto matched;
|
goto matched;
|
||||||
}
|
}
|
||||||
|
DIAG_POP_NEEDS_COMMENT;
|
||||||
|
|
||||||
/* Get the collation sequence value. */
|
/* Get the collation sequence value. */
|
||||||
is_seqval = true;
|
is_seqval = true;
|
||||||
# if WIDE_CHAR_VERSION
|
# if WIDE_CHAR_VERSION
|
||||||
|
/* The compile might warn that wextra may be
|
||||||
|
used uninitialized and similar to 'idx'
|
||||||
|
above it will be properly set by the loop.
|
||||||
|
*/
|
||||||
|
DIAG_PUSH_NEEDS_COMMENT;
|
||||||
|
DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
|
||||||
cold = wextra[1 + wextra[0]];
|
cold = wextra[1 + wextra[0]];
|
||||||
|
DIAG_POP_NEEDS_COMMENT;
|
||||||
# else
|
# else
|
||||||
idx += 1 + extra[idx];
|
idx += 1 + extra[idx];
|
||||||
/* Adjust for the alignment. */
|
/* Adjust for the alignment. */
|
||||||
|
|
@ -723,9 +739,24 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
|
||||||
/* Get the collation sequence value. */
|
/* Get the collation sequence value. */
|
||||||
is_seqval = true;
|
is_seqval = true;
|
||||||
# if WIDE_CHAR_VERSION
|
# if WIDE_CHAR_VERSION
|
||||||
|
/* The compiler might warn that wextra may
|
||||||
|
be used uninitialized, however it will
|
||||||
|
be reached iff elem < table_size which
|
||||||
|
means that it was properly set in the
|
||||||
|
loop above. */
|
||||||
|
DIAG_PUSH_NEEDS_COMMENT;
|
||||||
|
DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
|
||||||
cend = wextra[1 + wextra[0]];
|
cend = wextra[1 + wextra[0]];
|
||||||
|
DIAG_POP_NEEDS_COMMENT;
|
||||||
# else
|
# else
|
||||||
|
/* The compile might warn that idx may
|
||||||
|
be used uninitialized and similar to
|
||||||
|
wextra above it will be properly set by
|
||||||
|
the loop. */
|
||||||
|
DIAG_PUSH_NEEDS_COMMENT;
|
||||||
|
DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
|
||||||
idx += 1 + extra[idx];
|
idx += 1 + extra[idx];
|
||||||
|
DIAG_POP_NEEDS_COMMENT;
|
||||||
/* Adjust for the alignment. */
|
/* Adjust for the alignment. */
|
||||||
idx = (idx + 3) & ~3;
|
idx = (idx + 3) & ~3;
|
||||||
cend = *((int32_t *) &extra[idx]);
|
cend = *((int32_t *) &extra[idx]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue