Suppress regcomp.c warnings in 32-bit builds.

This commit is contained in:
Roland McGrath 2012-08-15 16:03:58 -07:00
parent e04e272d21
commit 329bc01868
2 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,8 @@
2012-08-15 Roland McGrath <roland@hack.frob.com>
* posix/regcomp.c (init_word_char): Use temporaries to hold the 64-bit
constants, which avoids warnings in 32-bit builds.
* bits/fcntl.h [__USE_POSIX199309 || __USE_UNIX98]:
(O_DSYNC, O_RSYNC): New macros (with NetBSD values).

View File

@ -932,8 +932,12 @@ init_word_char (re_dfa_t *dfa)
{
if (sizeof (dfa->word_char[0]) == 8)
{
dfa->word_char[0] = UINT64_C (0x03ff000000000000);
dfa->word_char[1] = UINT64_C (0x07fffffe87fffffe);
/* The extra temporaries here avoid "implicitly truncated"
warnings in the case when this is dead code, i.e. 32-bit. */
const uint64_t wc0 = UINT64_C (0x03ff000000000000);
const uint64_t wc1 = UINT64_C (0x07fffffe87fffffe);
dfa->word_char[0] = wc0;
dfa->word_char[1] = wc1;
i = 2;
}
else if (sizeof (dfa->word_char[0]) == 4)