This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: patch: unused variables


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"
>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]