FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 04-03-2011, 06:14 AM
Sebastian Nowicki
 
Default Remove dead stores reported by clang-analyzer

Signed-off-by: Sebastian Nowicki <sebnow@gmail.com>
---
lib/libalpm/be_local.c | 2 +-
lib/libalpm/pkghash.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c
index 82c1d59..788b3c6 100644
--- a/lib/libalpm/be_local.c
+++ b/lib/libalpm/be_local.c
@@ -405,7 +405,7 @@ static int local_db_populate(pmdb_t *db)
* http://kerneltrap.org/mailarchive/linux-btrfs/2010/1/23/6723483/thread
*/
est_count = 0;
- while((ent = readdir(dbdir)) != NULL) {
+ while(readdir(dbdir) != NULL) {
est_count++;
}
rewinddir(dbdir);
diff --git a/lib/libalpm/pkghash.c b/lib/libalpm/pkghash.c
index 761ca72..b4dfcb6 100644
--- a/lib/libalpm/pkghash.c
+++ b/lib/libalpm/pkghash.c
@@ -84,12 +84,11 @@ pmpkghash_t *_alpm_pkghash_create(size_t size)
static size_t get_hash_position(unsigned long name_hash, pmpkghash_t *hash)
{
size_t position;
- alpm_list_t *ptr;

position = name_hash % hash->buckets;

/* collision resolution using open addressing with linear probing */
- while((ptr = hash->hash_table[position]) != NULL) {
+ while(hash->hash_table[position] != NULL) {
position = (position + 1) % hash->buckets;
}

--
1.7.4.2
 
Old 04-04-2011, 08:58 AM
Xavier
 
Default Remove dead stores reported by clang-analyzer

Allan McRae wrote:
>
> Please send patches to the list so that we can complain about issues like:
>
> aba191d5 (Xavier Chantry 2011-04-03 10:28:09 +0200 276)
> printf("%lc", *p);
>
> util.c: In function ‘indentprint’:
> util.c:276:3: error: format ‘%lc’ expects argument of type ‘wint_t’,
> but argument 2 has type ‘wchar_t’ [-Werror=format]
> cc1: all warnings being treated as errors
>
>

This one was not supposed to be committed, I know Dan would have rejected it
anyway.
I was just pissed off by this dumb issue, and I did not manage to make gcc
break. Is that with gcc 4.6 (I was on 4.5) ?
 

Thread Tools




All times are GMT. The time now is 01:02 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org