Bug 1961 - Patches for a couple of clang warnings
Summary: Patches for a couple of clang warnings
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Other (show other bugs)
Version: 3.7.4
Hardware: PC FreeBSD
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2009-07-22 17:21 UTC by Fabian Keil
Modified: 2012-09-12 09:29 UTC (History)
0 users

See Also:


Attachments
tarball with patches against claws-mail-3.7.2cvs11 (19.42 KB, application/octet-stream)
2009-07-22 17:21 UTC, Fabian Keil
no flags Details
Second try, rebased on 3.7.2cvs15, patches grouped together (16.88 KB, application/gzip)
2009-08-01 17:59 UTC, Fabian Keil
no flags Details

Description Fabian Keil 2009-07-22 17:21:20 UTC
Created attachment 700 [details]
tarball with patches against claws-mail-3.7.2cvs11

The attached tarball contains patches for a couple of clang warnings.

Most of them are cosmetics, but the first ones could fix actual
bugs (mostly crashes due to dereferenced NULL pointers).

I've been using the patches since 3.7.1 without any problems,
but as I only use Claws Mail for mails, some of them are only
compile-tested.

Occasionally I had to guess the proper fix, so some of them
may be wrong. Even the incorrect ones should be useful to
highlight the problem, though.
Comment 1 Colin Leroy 2009-07-28 13:10:36 UTC
Phew, that's a rather huge "couple" :-)

Could you rework the tarball so that patches for the same kind of error are in the same file ? (and put the "unsure" ones in another file)

Thanks a lot!
Comment 2 Fabian Keil 2009-07-28 17:36:14 UTC
Will do. Probably not before the weekend, though.
Comment 3 Fabian Keil 2009-08-01 17:59:00 UTC
Created attachment 704 [details]
Second try, rebased on 3.7.2cvs15, patches grouped together

I rebased the patches on 3.7.2cvs15 and sorted them into six files.

style-compliance.diff doesn't fix any warnings and may not
be worth it out of context, but I included it anyway.
Comment 4 Fabian Keil 2010-01-22 22:17:23 UTC
I just tried the patches against 3.7.4.

All apply cleanly except two that are no longer necessary.
Comment 5 users 2012-09-12 08:53:35 UTC
Changes related to this bug have been committed.
Please check latest CVS and update the bug accordingly.
You can also get the patch from:
http://www.claws-mail.org/tracker/

2012-09-12 [colin]	3.8.1cvs51

	* src/compose.c
	* src/mh.c
	* src/common/ssl.c
	* src/plugins/pgpcore/passphrase.c
		Apply patches from bug #1961, "patches for
		a couple of clang warnings":
		- Check return codes
		- Remove dead code
Comment 6 users 2012-09-12 09:24:37 UTC
Changes related to this bug have been committed.
Please check latest CVS and update the bug accordingly.
You can also get the patch from:
http://www.claws-mail.org/tracker/

2012-09-12 [colin]	3.8.1cvs52

	* src/addressbook.c
	* src/addrharvest.c
	* src/addrindex.c
	* src/addritem.c
	* src/compose.c
	* src/edittags.c
	* src/folder.c
	* src/imap.c
	* src/inc.c
	* src/ldif.c
	* src/mainwindow.c
	* src/mbox.c
	* src/mimeview.c
	* src/mutt.c
	* src/partial_download.c
	* src/prefs_filtering_action.c
	* src/prefs_toolbar.c
	* src/printing.c
	* src/procheader.c
	* src/procmime.c
	* src/procmsg.c
	* src/summaryview.c
	* src/textview.c
	* src/common/utils.c
	* src/etpan/imap-thread.c
	* src/gtk/gtkaspell.c
	* src/plugins/pgpcore/sgpgme.c
		More fixes from bug #1961:
		- Write-only variables
		- Null pointer dereferences
		- A couple other fixes for which the reporter
		  was unsure, but which showed problems.
		More details in bug #1961 comments.
Comment 7 users 2012-09-12 09:24:38 UTC
Changes related to this bug have been committed.
Please check latest CVS and update the bug accordingly.
You can also get the patch from:
http://www.claws-mail.org/tracker/

2012-09-12 [colin]	3.8.1cvs52

	* src/addressbook.c
	* src/addrharvest.c
	* src/addrindex.c
	* src/addritem.c
	* src/compose.c
	* src/edittags.c
	* src/folder.c
	* src/imap.c
	* src/inc.c
	* src/ldif.c
	* src/mainwindow.c
	* src/mbox.c
	* src/mimeview.c
	* src/mutt.c
	* src/partial_download.c
	* src/prefs_filtering_action.c
	* src/prefs_toolbar.c
	* src/printing.c
	* src/procheader.c
	* src/procmime.c
	* src/procmsg.c
	* src/summaryview.c
	* src/textview.c
	* src/common/utils.c
	* src/etpan/imap-thread.c
	* src/gtk/gtkaspell.c
	* src/plugins/pgpcore/sgpgme.c
		More fixes from bug #1961:
		- Write-only variables
		- Null pointer dereferences
		- A couple other fixes for which the reporter
		  was unsure, but which showed problems.
		More details in bug #1961 comments.
Comment 8 Colin Leroy 2012-09-12 09:29:20 UTC
Hi,

Better late than never... Patches applied. A few comments about unsure-ones.diff:

Subject: [PATCH 02/10] In procmsg_list_sort_by_account(), give nothing_to_sort the chance to be FALSE when it's checked. XXX: This is a guess.
Initially applied but I reverted it, I don't remember what this is supposed to do :)

Subject: [PATCH 03/10] Not sure about this one, but otherwise w_hbox would have no purpose.
w_hbox had no purpose :)

Subject: [PATCH 07/10] Remove interim variable tags. Maybe tmp should be renamed to tags.
In fact tags was there to keep the pointer at the start of the list in order to free it. This was a leak.

Subject: [PATCH 09/10] Remove write-only variable is_group.
Kept it, I find it makes the if logic more clear

Thanks for your patches !

Note You need to log in before you can comment on or make changes to this bug.