Re: attribute warn_unused_result
From: Con Kolivas
Date: Tue Sep 07 2004 - 07:46:26 EST
Arjan van de Ven wrote:
On Tue, 2004-09-07 at 14:23, Con Kolivas wrote:
Gcc3.4.1 has recently been complaining of a number of unused results
from function with attribute warn_unused_result set. I'm not sure of how
you want to tackle this so I'm avoiding posting patches. Should we
remove the attribute (seems the likely option) or set some dummy
variable (sounds stupid now that I ask it).
that attribute is supposed to only be set for functions you really ought
to check the result for.... so how about checking/using the result ?
I understand the concept... these are functions that seem to work fine
without using the return value... unless of course the original coders
aren't yet aware of that fact then I'm sorry. Here's the list just with
my config on 2.6.9-rc1-bk13:
sound/core/seq/seq_clientmgr.c: In function `snd_seq_read':
sound/core/seq/seq_clientmgr.c:423: warning: ignoring return value of
`copy_to_user', declared with attribute warn_unused_result
fs/binfmt_elf.c: In function `padzero':
fs/binfmt_elf.c:113: warning: ignoring return value of `clear_user',
declared with attribute warn_unused_result
include/asm/uaccess.h: In function `create_elf_tables':
fs/binfmt_elf.c:175: warning: ignoring return value of `__copy_to_user',
declared with attribute warn_unused_result
fs/binfmt_elf.c:273: warning: ignoring return value of `copy_to_user',
declared with attribute warn_unused_result
fs/binfmt_elf.c: In function `load_elf_binary':
fs/binfmt_elf.c:750: warning: ignoring return value of `clear_user',
declared with attribute warn_unused_result
fs/binfmt_elf.c: In function `fill_psinfo':
fs/binfmt_elf.c:1216: warning: ignoring return value of
`copy_from_user', declared with attribute warn_unused_result
net/ipv6/ip6_flowlabel.c: In function `ipv6_flowlabel_opt':
net/ipv6/ip6_flowlabel.c:541: warning: ignoring return value of
`copy_to_user', declared with attribute warn_unused_result
net/ipv4/netfilter/ip_tables.c: In function `do_replace':
net/ipv4/netfilter/ip_tables.c:1133: warning: ignoring return value of
`copy_to_user', declared with attribute warn_unused_result
net/ipv4/netfilter/arp_tables.c: In function `do_replace':
net/ipv4/netfilter/arp_tables.c:952: warning: ignoring return value of
`copy_to_user', declared with attribute warn_unused_result
Con
Attachment:
signature.asc
Description: OpenPGP digital signature