mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Premi, Sanjeev" <premi@ti.com>
To: Michal Marek <mmarek@suse.cz>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] kconfig: fix warnings due to unused return values
Date: Fri, 7 Oct 2011 14:49:16 +0530	[thread overview]
Message-ID: <B85A65D85D7EB246BE421B3FB0FBB59302579AD86F@dbde02.ent.ti.com> (raw)
In-Reply-To: <4E8C72B6.9030603@suse.cz>

> -----Original Message-----
> From: Michal Marek [mailto:mmarek@suse.cz] 
> Sent: Wednesday, October 05, 2011 8:38 PM
> To: Premi, Sanjeev
> Cc: linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] kconfig: fix warnings due to unused return values
> 
> On 22.9.2011 13:36, Sanjeev Premi wrote:
> > The return value of wattrset() is being ignored in the
> > code and newer compilers complain about this e.g.
> > 
> > HOSTCC  scripts/kconfig/lxdialog/checklist.o
> > scripts/kconfig/lxdialog/checklist.c: In function print_item:
> > scripts/kconfig/lxdialog/checklist.c:40: warning: value 
> computed is not used
> > scripts/kconfig/lxdialog/checklist.c:46: warning: value 
> computed is not used
> > 
> > Let the compiler know that ignore is intentional.
> > 
> > Signed-off-by: Sanjeev Premi <premi@ti.com>
> > ---
> > 
> >   The patch was created against the last pull from git.kernel.org
> >   The 'pull' from github is taking more than few hours...
> > 
> >   Based on the time stamps at this url, I believe the patch should
> >   apply cleanly:
> >    
> https://github.com/torvalds/linux/tree/master/scripts/kconfig/lxdialog
> 
> The latest kconfig tree is at http://repo.or.cz/w/linux-kbuild.git,
> branch kconfig. You can pull it by
> 
> $ git fetch git://repo.or.cz/linux-kbuild.git kconfig:kconfig

Sure, I will pull it.

> 
> > diff --git a/scripts/kconfig/lxdialog/checklist.c 
> b/scripts/kconfig/lxdialog/checklist.c
> > index a2eb80f..8407849 100644
> > --- a/scripts/kconfig/lxdialog/checklist.c
> > +++ b/scripts/kconfig/lxdialog/checklist.c
> > @@ -37,20 +37,20 @@ static void print_item(WINDOW * win, 
> int choice, int selected)
> >  	list_item[list_width - item_x] = '\0';
> >  
> >  	/* Clear 'residue' of last item */
> > -	wattrset(win, dlg.menubox.atr);
> > +	(void)wattrset(win, dlg.menubox.atr);
> >  	wmove(win, choice, 0);
> >  	for (i = 0; i < list_width; i++)
> >  		waddch(win, ' ');
> >  
> >  	wmove(win, choice, check_x);
> > -	wattrset(win, selected ? dlg.check_selected.atr
> > +	(void)wattrset(win, selected ? dlg.check_selected.atr
> 
> Uhm, not pretty.

Agree. But, of course, I am not too conversant with Kconfig code.
Just found these prints to be nagging after migrating to machines.

> What ncurses version are you using? Can you post the
> output of make V=1 menuconfig? It seems like wattrset is defined as a
> macro instead of a function call. FWIW, it does not print any warnings
> here with
> 
> $ rpm -qf /usr/include/ncurses
> ncurses-devel-5.8-2.6.x86_64
> and
> gcc version 4.6.1 20110801 [gcc-4_6-branch revision 177033] 
> (SUSE Linux)
> 
> on openSUSE Factory.
> 
> Michal
> 

I am on Ubuntu 10.04.1 LTS

premi #
premi # gcc --version
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
premi #
premi #
premi # dpkg --get-selections | grep curses
lib32ncurses5                                   install
libcurses-perl                                  install
libcurses-ui-perl                               install
libncurses5                                     install
libncurses5-dev                                 install
libncursesw5                                    install
ncurses-base                                    install
ncurses-bin                                     install
premi #
premi # make V=1 menuconfig
make -f scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
mkdir -p include/linux include/config
make -f scripts/Makefile.build obj=scripts/kconfig menuconfig
/bin/sh /home/premi/linux-omap-2.6/scripts/kconfig/lxdialog/check-lxdialog.sh -check gcc -DCURSES_LOC="<ncurses.h>" -DLOCALE  -lncurses
  gcc -Wp,-MD,scripts/kconfig/lxdialog/.checklist.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer   -DCURSES_LOC="<ncurses.h>" -DLOCALE   -c -o scripts/kconfig/lxdialog/checklist.o scripts/kconfig/lxdialog/checklist.c
scripts/kconfig/lxdialog/checklist.c: In function âprint_itemâ:
scripts/kconfig/lxdialog/checklist.c:40: warning: value computed is not used
scripts/kconfig/lxdialog/checklist.c:46: warning: value computed is not used
scripts/kconfig/lxdialog/checklist.c:51: warning: value computed is not used
scripts/kconfig/lxdialog/checklist.c:53: warning: value computed is not used
scripts/kconfig/lxdialog/checklist.c: In function âprint_arrowsâ:
scripts/kconfig/lxdialog/checklist.c:71: warning: value computed is not used
scripts/kconfig/lxdialog/checklist.c:75: warning: value computed is not used
scripts/kconfig/lxdialog/checklist.c:86: warning: value computed is not used
scripts/kconfig/lxdialog/checklist.c:90: warning: value computed is not used
scripts/kconfig/lxdialog/checklist.c: In function âdialog_checklistâ:
scripts/kconfig/lxdialog/checklist.c:153: warning: value computed is not used
scripts/kconfig/lxdialog/checklist.c:157: warning: value computed is not used
scripts/kconfig/lxdialog/checklist.c:162: warning: value computed is not used
  gcc -Wp,-MD,scripts/kconfig/lxdialog/.inputbox.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer   -DCURSES_LOC="<ncurses.h>" -DLOCALE   -c -o scripts/kconfig/lxdialog/inputbox.o scripts/kconfig/lxdialog/inputbox.c
scripts/kconfig/lxdialog/inputbox.c: In function âdialog_inputboxâ:
scripts/kconfig/lxdialog/inputbox.c:74: warning: value computed is not used
scripts/kconfig/lxdialog/inputbox.c:78: warning: value computed is not used
scripts/kconfig/lxdialog/inputbox.c:83: warning: value computed is not used
scripts/kconfig/lxdialog/inputbox.c:98: warning: value computed is not used
scripts/kconfig/lxdialog/inputbox.c:131: warning: value computed is not used
scripts/kconfig/lxdialog/inputbox.c:151: warning: value computed is not used
  gcc -Wp,-MD,scripts/kconfig/lxdialog/.menubox.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer   -DCURSES_LOC="<ncurses.h>" -DLOCALE   -c -o scripts/kconfig/lxdialog/menubox.o scripts/kconfig/lxdialog/menubox.c
scripts/kconfig/lxdialog/menubox.c: In function âdo_print_itemâ:
scripts/kconfig/lxdialog/menubox.c:77: warning: value computed is not used
scripts/kconfig/lxdialog/menubox.c:88: warning: value computed is not used
scripts/kconfig/lxdialog/menubox.c:91: warning: value computed is not used
scripts/kconfig/lxdialog/menubox.c: In function âprint_arrowsâ:
scripts/kconfig/lxdialog/menubox.c:121: warning: value computed is not used
scripts/kconfig/lxdialog/menubox.c:125: warning: value computed is not used
scripts/kconfig/lxdialog/menubox.c:137: warning: value computed is not used
scripts/kconfig/lxdialog/menubox.c:141: warning: value computed is not used
scripts/kconfig/lxdialog/menubox.c: In function âdialog_menuâ:
scripts/kconfig/lxdialog/menubox.c:214: warning: value computed is not used
scripts/kconfig/lxdialog/menubox.c:218: warning: value computed is not used
scripts/kconfig/lxdialog/menubox.c:224: warning: value computed is not used
  gcc -Wp,-MD,scripts/kconfig/lxdialog/.textbox.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer   -DCURSES_LOC="<ncurses.h>" -DLOCALE   -c -o scripts/kconfig/lxdialog/textbox.o scripts/kconfig/lxdialog/textbox.c
scripts/kconfig/lxdialog/textbox.c: In function âdialog_textboxâ:
scripts/kconfig/lxdialog/textbox.c:98: warning: value computed is not used
scripts/kconfig/lxdialog/textbox.c:107: warning: value computed is not used
scripts/kconfig/lxdialog/textbox.c:111: warning: value computed is not used
scripts/kconfig/lxdialog/textbox.c: In function âprint_positionâ:
scripts/kconfig/lxdialog/textbox.c:386: warning: value computed is not used
  gcc -Wp,-MD,scripts/kconfig/lxdialog/.util.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer   -DCURSES_LOC="<ncurses.h>" -DLOCALE   -c -o scripts/kconfig/lxdialog/util.o scripts/kconfig/lxdialog/util.c
scripts/kconfig/lxdialog/util.c: In function âattr_clearâ:
scripts/kconfig/lxdialog/util.c:243: warning: value computed is not used
scripts/kconfig/lxdialog/util.c: In function âdialog_clearâ:
scripts/kconfig/lxdialog/util.c:259: warning: value computed is not used
scripts/kconfig/lxdialog/util.c: In function âprint_titleâ:
scripts/kconfig/lxdialog/util.c:316: warning: value computed is not used
scripts/kconfig/lxdialog/util.c: In function âprint_buttonâ:
scripts/kconfig/lxdialog/util.c:396: warning: value computed is not used
scripts/kconfig/lxdialog/util.c:401: warning: value computed is not used
scripts/kconfig/lxdialog/util.c:405: warning: value computed is not used
scripts/kconfig/lxdialog/util.c:408: warning: value computed is not used
scripts/kconfig/lxdialog/util.c:411: warning: value computed is not used
scripts/kconfig/lxdialog/util.c: In function âdraw_shadowâ:
scripts/kconfig/lxdialog/util.c:460: warning: value computed is not used
  gcc -Wp,-MD,scripts/kconfig/lxdialog/.yesno.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer   -DCURSES_LOC="<ncurses.h>" -DLOCALE   -c -o scripts/kconfig/lxdialog/yesno.o scripts/kconfig/lxdialog/yesno.c
scripts/kconfig/lxdialog/yesno.c: In function âdialog_yesnoâ:
scripts/kconfig/lxdialog/yesno.c:64: warning: value computed is not used
scripts/kconfig/lxdialog/yesno.c:68: warning: value computed is not used
scripts/kconfig/lxdialog/yesno.c:73: warning: value computed is not used
  gcc -Wp,-MD,scripts/kconfig/.mconf.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer   -DCURSES_LOC="<ncurses.h>" -DLOCALE   -c -o scripts/kconfig/mconf.o scripts/kconfig/mconf.c
  gcc  -o scripts/kconfig/mconf scripts/kconfig/mconf.o scripts/kconfig/zconf.tab.o scripts/kconfig/lxdialog/checklist.o scripts/kconfig/lxdialog/util.o scripts/kconfig/lxdialog/inputbox.o scripts/kconfig/lxdialog/textbox.o scripts/kconfig/lxdialog/yesno.o scripts/kconfig/lxdialog/menubox.o  -lncurses
scripts/kconfig/mconf Kconfig

  reply	other threads:[~2011-10-07  9:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22 11:36 Sanjeev Premi
2011-10-03 14:48 ` Premi, Sanjeev
2011-10-05 15:07 ` Michal Marek
2011-10-07  9:19   ` Premi, Sanjeev [this message]
2011-10-12 12:30     ` Premi, Sanjeev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B85A65D85D7EB246BE421B3FB0FBB59302579AD86F@dbde02.ent.ti.com \
    --to=premi@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®