patch: unused variables
J. Johnston
jjohnstn@cygnus.com
Thu Aug 24 09:28:00 GMT 2000
Werner Almesberger wrote:
>
> Here's a patch that eliminates a few unused variable warnings.
>
> Some of my changes are of the controversial type
> #ifdef SOMETHING
> int foo;
> #endif
>
> An alternative would be to define a macro __UNUSED or such that becomes
> __attribute__((unused)) with GCC, nothing with other compilers, leave
> the variables in, and flag them with __UNUSED. Probably overkill, but
> if somebody really hates those mini-ifdefs, I'll make a patch with
> __UNUSED.
>
The defines you chose to use were quite appropriate. Patch has been applied.
-- Jeff Johnston (Red Hat Inc)
> ---------------------------------- ChangeLog ----------------------------------
>
> 2000-08-23 Werner Almesberger <Werner.Almesberger@epfl.ch>
> * libc/stdio/stdio.c (__swrite): declare "oldmode" only if it's
> used later (ifdef __SCLE)
> * libc/stdio/vfscanf.c (__svfscanf): declare "state" only if it's
> used later (ifdef MB_CAPABLE)
> * libc/string/memset.c (memset): removed unused variables "count"
> and "unaligned_addr"
> * libc/locale/locale.c (_setlocale_r): declare "lc_ctype" and
> "last_lc_ctype" only of they're used later (ifdef MB_CAPABLE)
> * libc/unix/getpwent.c (getpwnam): removed unused variables "uid"
> and "gid"
>
More information about the Newlib
mailing list