This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch roland/Wshadow created. glibc-2.20-84-gc4426bb
- From: roland at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 10 Oct 2014 21:22:17 -0000
- Subject: GNU C Library master sources branch roland/Wshadow created. glibc-2.20-84-gc4426bb
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, roland/Wshadow has been created
at c4426bb130e2f46fd3a6e1c0db9c174bcf75dc1e (commit)
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c4426bb130e2f46fd3a6e1c0db9c174bcf75dc1e
commit c4426bb130e2f46fd3a6e1c0db9c174bcf75dc1e
Author: Roland McGrath <roland@hack.frob.com>
Date: Fri Oct 10 14:21:55 2014 -0700
foo
diff --git a/ChangeLog b/ChangeLog
index f0d3d57..61bd5c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,34 @@
+2014-10-09 Roland McGrath <roland@hack.frob.com>
+
+ * stdio-common/printf_fphex.c (__printf_fphex): Remove superfluous
+ block-local variable WIDTH in the SPECIAL case.
+
+ * sysdeps/x86_64/nptl/tls.h (THREAD_SELF): Rename local variable
+ __SELF inside statement expression to __THREAD_SELF.
+
+ * stdlib/strtod_l.c (____STRTOF_INTERNAL): Rename inner-block local
+ variable RETVAL to RESULT. Move function-level START_OF_DIGITS and
+ STARTP local variables' declarations to their initialization sites.
+ (____STRTOF_INTERNAL: got_limb): Rename block-local variable CNT
+ to ZERO_COUNT.
+ (__mpn_lshift_1): Rename block-local variable I inside statement
+ expression to _I.
+
+ * sysdeps/unix/sysv/linux/x86_64/sysdep.h (INTERNAL_SYSCALL_NCS):
+ Rename local variable RESULTVAR to NCS_RESULT.
+ (INTERNAL_SYSCALL_NCS_TYPES): Likewise.
+
+ * iconv/gconv_int.h (norm_add_slashes): Use _ prefix on local
+ variables inside the statement expression.
+ * stdlib/setenv.c (KNOWN_VALUE): Likewise.
+
+ * iconv/gconv_simple.c (BODY for internal_utf8_loop): Rename local
+ variable STEP to STEP_SIZE.
+
+ * locale/localeinfo.h (enum value_type): Prefix elements with "vt_".
+ * locale/loadlocale.c (DEFINE_ELEMENT): Prepend the prefix here.
+ * locale/loadlocale.c (_nl_intern_locale_data): Update user.
+
2014-10-09 Kostya Serebryany <konstantin.s.serebryany@gmail.com>
* elf/dl-load.c
diff --git a/Makeconfig b/Makeconfig
index 24a3b82..70c760b 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -716,7 +716,7 @@ ifeq ($(all-warnings),yes)
else
+gccwarn := -Wall -Wwrite-strings -Winline
endif
-+gccwarn += -Wundef
++gccwarn += -Wundef -Werror=shadow
+gccwarn-c = -Wstrict-prototypes -Werror=implicit-function-declaration
# We do not depend on the address of constants in different files to be
diff --git a/iconv/gconv_int.h b/iconv/gconv_int.h
index 13b0e99..9c56a2d 100644
--- a/iconv/gconv_int.h
+++ b/iconv/gconv_int.h
@@ -123,34 +123,34 @@ __libc_lock_define (extern, __gconv_lock attribute_hidden)
/* The gconv functions expects the name to be in upper case and complete,
including the trailing slashes if necessary. */
-#define norm_add_slashes(str,suffix) \
+#define norm_add_slashes(str, suffix) \
({ \
- const char *cp = (str); \
- char *result; \
- char *tmp; \
- size_t cnt = 0; \
- const size_t suffix_len = strlen (suffix); \
+ const char *_cp = (str); \
+ char *_result; \
+ char *_tmp; \
+ size_t _cnt = 0; \
+ const size_t _suffix_len = strlen (suffix); \
\
- while (*cp != '\0') \
- if (*cp++ == '/') \
- ++cnt; \
+ while (*_cp != '\0') \
+ if (*_cp++ == '/') \
+ ++_cnt; \
\
- tmp = result = __alloca (cp - (str) + 3 + suffix_len); \
- cp = (str); \
- while (*cp != '\0') \
- *tmp++ = __toupper_l (*cp++, _nl_C_locobj_ptr); \
- if (cnt < 2) \
+ _tmp = _result = __alloca (_cp - (str) + 3 + _suffix_len); \
+ _cp = (str); \
+ while (*_cp != '\0') \
+ *_tmp++ = __toupper_l (*_cp++, _nl_C_locobj_ptr); \
+ if (_cnt < 2) \
{ \
- *tmp++ = '/'; \
- if (cnt < 1) \
+ *_tmp++ = '/'; \
+ if (_cnt < 1) \
{ \
- *tmp++ = '/'; \
- if (suffix_len != 0) \
- tmp = __mempcpy (tmp, suffix, suffix_len); \
+ *_tmp++ = '/'; \
+ if (_suffix_len != 0) \
+ _tmp = __mempcpy (_tmp, suffix, _suffix_len); \
} \
} \
- *tmp = '\0'; \
- result; \
+ *_tmp = '\0'; \
+ _result; \
})
diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c
index 4ed4505..9bc2453 100644
--- a/iconv/gconv_simple.c
+++ b/iconv/gconv_simple.c
@@ -892,14 +892,14 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
*outptr++ = (unsigned char) wc; \
else if (__glibc_likely (wc <= 0x7fffffff)) \
{ \
- size_t step; \
+ size_t step_size; \
unsigned char *start; \
\
- for (step = 2; step < 6; ++step) \
- if ((wc & (~(uint32_t)0 << (5 * step + 1))) == 0) \
+ for (step_size = 2; step_size < 6; ++step_size) \
+ if ((wc & (~(uint32_t)0 << (5 * step_size + 1))) == 0) \
break; \
\
- if (__glibc_unlikely (outptr + step > outend)) \
+ if (__glibc_unlikely (outptr + step_size > outend)) \
{ \
/* Too long. */ \
result = __GCONV_FULL_OUTPUT; \
@@ -907,14 +907,14 @@ ucs4le_internal_loop_single (struct __gconv_step *step,
} \
\
start = outptr; \
- *outptr = (unsigned char) (~0xff >> step); \
- outptr += step; \
+ *outptr = (unsigned char) (~0xff >> step_size); \
+ outptr += step_size; \
do \
{ \
- start[--step] = 0x80 | (wc & 0x3f); \
+ start[--step_size] = 0x80 | (wc & 0x3f); \
wc >>= 6; \
} \
- while (step > 1); \
+ while (step_size > 1); \
start[0] |= wc; \
} \
else \
diff --git a/locale/loadlocale.c b/locale/loadlocale.c
index 13eecea..3530a1a 100644
--- a/locale/loadlocale.c
+++ b/locale/loadlocale.c
@@ -47,7 +47,7 @@ static const size_t _nl_category_num_items[] =
#define DEFINE_CATEGORY(category, category_name, items, a) \
static const enum value_type _nl_value_type_##category[] = { NO_PAREN items };
#define DEFINE_ELEMENT(element, element_name, optstd, type, rest...) \
- [_NL_ITEM_INDEX (element)] = type,
+ [_NL_ITEM_INDEX (element)] = vt_##type,
#include "categories.def"
#undef DEFINE_CATEGORY
@@ -144,7 +144,7 @@ _nl_intern_locale_data (int category, const void *data, size_t datasize)
if ((category == LC_CTYPE
&& cnt >= (sizeof (_nl_value_type_LC_CTYPE)
/ sizeof (_nl_value_type_LC_CTYPE[0])))
- || __builtin_expect (_nl_value_types[category][cnt] != word, 1))
+ || __builtin_expect (_nl_value_types[category][cnt] != vt_word, 1))
newdata->values[cnt].string = newdata->filedata + idx;
else
{
diff --git a/locale/localeinfo.h b/locale/localeinfo.h
index 070914d..f9dcdb6 100644
--- a/locale/localeinfo.h
+++ b/locale/localeinfo.h
@@ -113,17 +113,17 @@ enum coll_sort_rule
/* We can map the types of the entries into a few categories. */
enum value_type
{
- none,
- string,
- stringarray,
- byte,
- bytearray,
- word,
- stringlist,
- wordarray,
- wstring,
- wstringarray,
- wstringlist
+ vt_none,
+ vt_string,
+ vt_stringarray,
+ vt_byte,
+ vt_bytearray,
+ vt_word,
+ vt_stringlist,
+ vt_wordarray,
+ vt_wstring,
+ vt_wstringarray,
+ vt_wstringlist
};
diff --git a/stdio-common/printf_fphex.c b/stdio-common/printf_fphex.c
index 4599867..78733a7 100644
--- a/stdio-common/printf_fphex.c
+++ b/stdio-common/printf_fphex.c
@@ -240,8 +240,6 @@ __printf_fphex (FILE *fp,
if (special)
{
- int width = info->width;
-
if (negative || info->showsign || info->space)
--width;
width -= 3;
diff --git a/stdlib/setenv.c b/stdlib/setenv.c
index 8de5328..666f5ad 100644
--- a/stdlib/setenv.c
+++ b/stdlib/setenv.c
@@ -79,8 +79,8 @@ static void *known_values;
# define KNOWN_VALUE(Str) \
({ \
- void *value = tfind (Str, &known_values, (__compar_fn_t) strcmp); \
- value != NULL ? *(char **) value : NULL; \
+ void *_value = tfind (Str, &known_values, (__compar_fn_t) strcmp); \
+ _value != NULL ? *(char **) _value : NULL; \
})
# define STORE_VALUE(Str) \
tsearch (Str, &known_values, (__compar_fn_t) strcmp)
diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c
index 3c449c7..41578e3 100644
--- a/stdlib/strtod_l.c
+++ b/stdlib/strtod_l.c
@@ -458,9 +458,9 @@ str_to_mpn (const STRING_TYPE *str, int digcnt, mp_limb_t *n, mp_size_t *nsize,
mp_limb_t *__ptr = (ptr); \
if (__builtin_constant_p (count) && count == BITS_PER_MP_LIMB) \
{ \
- mp_size_t i; \
- for (i = (size) - 1; i > 0; --i) \
- __ptr[i] = __ptr[i - 1]; \
+ mp_size_t _i; \
+ for (_i = (size) - 1; _i > 0; --_i) \
+ __ptr[_i] = __ptr[_i - 1]; \
__ptr[0] = (limb); \
} \
else \
@@ -515,8 +515,6 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
/* Running pointer after the last character processed in the string. */
const STRING_TYPE *cp, *tp;
- /* Start of significant part of the number. */
- const STRING_TYPE *startp, *start_of_digits;
/* Points at the character following the integer and fractional digits. */
const STRING_TYPE *expp;
/* Total number of digit and number of digits in integer part. */
@@ -647,7 +645,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
if (lowc == L_('n') && STRNCASECMP (cp, L_("nan"), 3) == 0)
{
/* Return NaN. */
- FLOAT retval = NAN;
+ FLOAT result = NAN;
cp += 3;
@@ -677,7 +675,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
mant = STRTOULL (startp + 1, &endp, 0);
if (endp == cp)
- SET_MANTISSA (retval, mant);
+ SET_MANTISSA (result, mant);
/* Consume the closing brace. */
++cp;
@@ -687,7 +685,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
if (endptr != NULL)
*endptr = (STRING_TYPE *) cp;
- return retval;
+ return result;
}
/* It is really a text we do not recognize. */
@@ -707,7 +705,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
}
/* Record the start of the digits, in case we will check their grouping. */
- start_of_digits = startp = cp;
+ const STRING_TYPE *start_of_digits = cp;
/* Ignore leading zeroes. This helps us to avoid useless computations. */
#ifdef USE_WIDE_CHAR
@@ -777,7 +775,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
/* Remember first significant digit and read following characters until the
decimal point, exponent character or any non-FP number character. */
- startp = cp;
+ const STRING_TYPE *startp = cp;
dig_no = 0;
while (1)
{
@@ -1349,7 +1347,6 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
int neg_exp;
int more_bits;
int need_frac_digits;
- mp_limb_t cy;
mp_limb_t *psrc = den;
mp_limb_t *pdest = num;
const struct mp_power *ttab = &_fpioconst_pow10[0];
@@ -1470,7 +1467,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
/* Don't call `mpn_shift' with a count of zero since the specification
does not allow this. */
(void) __mpn_lshift (den, den, densize, cnt);
- cy = __mpn_lshift (num, num, numsize, cnt);
+ mp_limb_t cy = __mpn_lshift (num, num, numsize, cnt);
if (cy != 0)
num[numsize++] = cy;
}
@@ -1502,15 +1499,15 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
#define got_limb \
if (bits == 0) \
{ \
- int cnt; \
+ int zero_count; \
if (quot == 0) \
- cnt = BITS_PER_MP_LIMB; \
+ zero_count = BITS_PER_MP_LIMB; \
else \
- count_leading_zeros (cnt, quot); \
- exponent -= cnt; \
- if (BITS_PER_MP_LIMB - cnt > MANT_DIG) \
+ count_leading_zeros (zero_count, quot); \
+ exponent -= zero_count; \
+ if (BITS_PER_MP_LIMB - zero_count > MANT_DIG) \
{ \
- used = MANT_DIG + cnt; \
+ used = MANT_DIG + zero_count; \
retval[0] = quot >> (BITS_PER_MP_LIMB - used); \
bits = MANT_DIG + 1; \
} \
@@ -1521,7 +1518,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
if (RETURN_LIMB_SIZE > 1) \
retval[1] = 0; \
retval[0] = quot; \
- bits = -cnt; \
+ bits = -zero_count; \
} \
} \
else if (bits + BITS_PER_MP_LIMB <= MANT_DIG) \
@@ -1654,7 +1651,6 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
if (numsize < densize)
{
mp_size_t empty = densize - numsize;
- int i;
if (bits <= 0)
exponent -= empty * BITS_PER_MP_LIMB;
@@ -1682,7 +1678,6 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
used = MANT_DIG - bits;
if (used >= BITS_PER_MP_LIMB)
{
- int i;
(void) __mpn_lshift (&retval[used
/ BITS_PER_MP_LIMB],
retval,
@@ -1703,7 +1698,6 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
}
else
{
- int i;
assert (numsize == densize);
for (i = numsize; i > 0; --i)
num[i] = num[i - 1];
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index 4a619da..f062bda 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -217,30 +217,28 @@
# undef INTERNAL_SYSCALL_DECL
# define INTERNAL_SYSCALL_DECL(err) do { } while (0)
-# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
+# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
({ \
- unsigned long int resultvar; \
+ unsigned long int ncs_result; \
LOAD_ARGS_##nr (args) \
LOAD_REGS_##nr \
- asm volatile ( \
- "syscall\n\t" \
- : "=a" (resultvar) \
- : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx"); \
- (long int) resultvar; })
+ asm volatile ("syscall" \
+ : "=a" (ncs_result) \
+ : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx"); \
+ (long int) ncs_result; })
# undef INTERNAL_SYSCALL
# define INTERNAL_SYSCALL(name, err, nr, args...) \
INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args)
-# define INTERNAL_SYSCALL_NCS_TYPES(name, err, nr, args...) \
+# define INTERNAL_SYSCALL_NCS_TYPES(name, err, nr, args...) \
({ \
- unsigned long int resultvar; \
+ unsigned long int ncs_result; \
LOAD_ARGS_TYPES_##nr (args) \
LOAD_REGS_TYPES_##nr (args) \
- asm volatile ( \
- "syscall\n\t" \
- : "=a" (resultvar) \
- : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx"); \
- (long int) resultvar; })
+ asm volatile ("syscall" \
+ : "=a" (ncs_result) \
+ : "0" (name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx"); \
+ (long int) ncs_result; })
# undef INTERNAL_SYSCALL_TYPES
# define INTERNAL_SYSCALL_TYPES(name, err, nr, args...) \
INTERNAL_SYSCALL_NCS_TYPES (__NR_##name, err, nr, ##args)
diff --git a/sysdeps/x86_64/nptl/tls.h b/sysdeps/x86_64/nptl/tls.h
index 3e811b6..63a3992 100644
--- a/sysdeps/x86_64/nptl/tls.h
+++ b/sysdeps/x86_64/nptl/tls.h
@@ -177,13 +177,13 @@ typedef struct
The contained asm must *not* be marked volatile since otherwise
assignments like
- pthread_descr self = thread_self();
+ pthread_descr self = THREAD_SELF;
do not get optimized away. */
# define THREAD_SELF \
- ({ struct pthread *__self; \
- asm ("mov %%fs:%c1,%0" : "=r" (__self) \
+ ({ struct pthread *__thread_self; \
+ asm ("mov %%fs:%c1,%0" : "=r" (__thread_self) \
: "i" (offsetof (struct pthread, header.self))); \
- __self;})
+ __thread_self;})
/* Magic for libthread_db to know how to do THREAD_SELF. */
# define DB_THREAD_SELF_INCLUDE <sys/reg.h> /* For the FS constant. */
-----------------------------------------------------------------------
hooks/post-receive
--
GNU C Library master sources