Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 568350 - sys-libc/uclibc: quiet down 'set but not used' warnings on MIPS with recent compilers
Summary: sys-libc/uclibc: quiet down 'set but not used' warnings on MIPS with recent c...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: MIPS Linux
: Normal normal (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: uclibc-porting
  Show dependency tree
 
Reported: 2015-12-15 19:45 UTC by Joshua Kinard
Modified: 2016-04-03 01:58 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Quiet down gcc warnings on MIPS due to -Wunused-but-set-variable (uClibc-0.9.33.2-mips-quiet-set_not_used-warnings.patch,4.59 KB, patch)
2015-12-15 19:45 UTC, Joshua Kinard
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Kinard gentoo-dev 2015-12-15 19:45:58 UTC
Created attachment 419290 [details, diff]
Quiet down gcc warnings on MIPS due to -Wunused-but-set-variable

With a recent gcc on a MIPS platform, uclibc's compile phase generates innumerable warnings due to the '-Wunused-but-set-variable' being active:

  CC libpthread/nptl_db/td_thr_setprio.oS
In file included from ./include/atomic.h:51:0,
                 from ./libpthread/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h:26,
                 from libpthread/nptl_db/../nptl/descr.h:30,
                 from libpthread/nptl_db/../nptl/pthreadP.h:27,
                 from libpthread/nptl_db/thread_dbP.h:31,
                 from libpthread/nptl_db/td_thr_event_getmsg.c:21:
./libpthread/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h: In function '__lll_cond_lock':
./include/bits/atomic.h:139:20: warning: variable '__prev' set but not used [-Wunused-but-set-variable]
 ({ __typeof (*mem) __prev; int __cmp;     \
                    ^
./include/atomic.h:75:23: note: in expansion of macro '__arch_compare_and_exchange_bool_8_int'
       __atg2_result = pre##_8_##post (mem, __VA_ARGS__);        \
                       ^
./include/bits/atomic.h:184:3: note: in expansion of macro '__atomic_bool_bysize'
   __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \
   ^
./libpthread/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h:194:7: note: in expansion of macro 'atomic_compare_and_exchange_bool_acq'
   if (atomic_compare_and_exchange_bool_acq (futex, 2, 0) != 0)
       ^
./include/bits/atomic.h:144:20: warning: variable '__prev' set but not used [-Wunused-but-set-variable]
 ({ __typeof (*mem) __prev; int __cmp;     \
                    ^
./include/atomic.h:77:23: note: in expansion of macro '__arch_compare_and_exchange_bool_16_int'
       __atg2_result = pre##_16_##post (mem, __VA_ARGS__);        \
                       ^

Quick check on Google found a patch which works well to quiet down these warnings so that the uclibc compile phase is cleaner, and proper errors can be more easily noticed:
http://lists.uclibc.org/pipermail/uclibc/2014-January/048196.html

I've re-diffed the patch due to some file offsets and attached it here.
Comment 1 SpanKY gentoo-dev 2016-04-03 01:58:10 UTC
considering the warnings are entirely harmless, this should just go upstream