commit cdf20aaf0a8b39a1f1ee427570a717f1c44ba272 Author: brobecke Date: Wed Dec 30 10:28:08 2009 +0000 Work around a -Wunused warning when glibc is too old. * cp-namespace.c (cp_lookup_transparent_type_loop): Add cast to void in function return to avoid a compiler warning. diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index a7a387b..35bb36c 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -539,7 +539,10 @@ cp_lookup_transparent_type_loop (const char *name, const char *scope, full_name = alloca (scope_length + 2 + strlen (name) + 1); strncpy (full_name, scope, scope_length); - strncpy (full_name + scope_length, "::", 2); + /* Cast to void the return value of the following strncpy to avoid + a -Wunused warning from GCC when the glibc is too old (observed + with a 2.3.2 libc, while everything was fine with a 2.4 glibc). */ + (void) strncpy (full_name + scope_length, "::", 2); strcpy (full_name + scope_length + 2, name); return basic_lookup_transparent_type (full_name);