mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.cz>
To: Sanjeev Premi <premi@ti.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kconfig: fix warnings due to unused return values
Date: Wed, 05 Oct 2011 17:07:34 +0200	[thread overview]
Message-ID: <4E8C72B6.9030603@suse.cz> (raw)
In-Reply-To: <1316691396-25447-1-git-send-email-premi@ti.com>

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

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

  parent reply	other threads:[~2011-10-05 15:07 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 [this message]
2011-10-07  9:19   ` Premi, Sanjeev
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=4E8C72B6.9030603@suse.cz \
    --to=mmarek@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=premi@ti.com \
    /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

Powered by JetHome