[sylpheed:36593] Re: [ANNOUNCE] Sylpheed 3.6 released

Bill Priest priestwilliaml at gmail.com
Wed Jul 5 23:20:29 JST 2017


Hi Hiro,
  Long time sylpheed user.  I've built sylpheed on Linux with gcc and clang
and saw some minor compiler warnings fixed easily with appropriate casts.
One warning looks like a potential bug to me.
account.c:279:9: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
 * return (gboolean)g_hash_table_lookup(address_table, address);*
could be changed to the following to suppress the warning


*return (gboolean)(g_hash_table_lookup(address_table, address) !=
NULL);*virtual.c:
In function 'sinfo_hash':
virtual.c:185:6: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]

*  h = (guint)sinfo->folder;*
could be changed to the following to suppress the warning


*h = (guint) (intptr_t) sinfo->folder;*virtual.c: In function
'virtual_search_folder':
virtual.c:381:14: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]


*    matched = (gint)g_hash_table_lookup
(info->search_cache_table, &sinfo);*
this looks like a potential bug as g_hash_table_lookup returns a pointer
which is unlikely to have a value of 1 (SCACHE_MATCHED) used on the
following line; if I understand the code correctly it could be changed to
the following to fix the "bug"

*matched = g_hash_table_lookup                (info->search_cache_table,
&sinfo) ? (gint) SCACHE_MATCHED : (gint) SCACHE_NOT_MATCHED;*

addressbook.c: In function ‘addressbook_col_resized’:
addressbook.c:2017:34: warning: cast from pointer to integer of different
size [-Wpointer-to-int-cast]

*AddressBookListColumnPos type = (gint)data;*
could be changed to the following to suppress the warning
  *AddressBookListColumnPos type = (gint) (intptr_t) data;*

action.c:1224:13: warning: use of logical '&&' with constant operand
      [-Wconstant-logical-operand]

*        if (!(cond && GDK_INPUT_WRITE))*
this looks like a bug and probably should be


* if (!(cond & GDK_INPUT_WRITE))*codeconv.c:1955:18: warning: comparison of
constant -1 with expression of type
      'CharSet' is always true
[-Wtautological-constant-out-of-range-compare]

*  if (cur_charset != -1) {*
could be changed to the following to suppress the warning


*        if (cur_charset != (CharSet) -1) {*codeconv.c:2060:18: warning:
comparison of constant -1 with expression of type
      'CharSet' is always true
[-Wtautological-constant-out-of-range-compare]

*        if (out_charset != -1) {*could be changed to the following to
suppress the warning

*if (out_charset != (CharSet) -1) {*filter.c:569:78: warning: format
specifies type 'unsigned int' but the argument
      has type 'gsize' (aka 'unsigned long') [-Wformat]

*  ...%s: SIZE_GREATER: %u %s %d (KB)%s\n", G_STRFUNC, msginfo->size,
not_matc...*
could be changed to the following ot suppress the warning

*  ...%s: SIZE_GREATER: %zu %s %d (KB)%s\n", G_STRFUNC, msginfo->size,
not_matc...*
filter.c:572:86: warning: format specifies type 'long long' but the
argument has
      type 'gint64' (aka 'long') [-Wformat]

*  ...%s: AGE_GREATER: %lld (sec) %s %d (day)%s\n", G_STRFUNC, timediff,
not_ma...*could be changed to the following ot suppress the warning


*  ...%s: AGE_GREATER: %lld (sec) %s %d (day)%s\n", G_STRFUNC, (long long)
timediff, not_ma...*folder.c:1949:4: warning: format specifies type 'long
long' but the argument has
      type 'gint64' (aka 'long') [-Wformat]
                       * (gint64)item->mtime, item->new, item->unread,
ite...*
could be changed to the following ot suppress the warning


*(long long)item->mtime, item->new, item->unread, item->total);*imap.c:615:7:
warning: case value not in enumerated type 'IMAPAuthType'
      [-Wswitch]

*        switch (type) {*

*        case 0:*could be changed to the following ot suppress the warning

*        switch ((int) type) {*

*        case 0:*procmime.c:1892:39: warning: format specifies type 'int'
but the argument has
      type 'size_t' (aka 'unsigned long') [-Wformat]

*                    "8bit chars: %d / %d (%f%%)\n", octet_chars,
total_len,*could be changed to the following ot suppress the warning



*                    "8bit chars: %zu / %zu (%f%%)\n", octet_chars,
total_len,*procmime.c:1927:39: warning: format specifies type 'int' but the
argument has
      type 'size_t' (aka 'unsigned long') [-Wformat]
procmime.c:1927:52: warning: format specifies type 'int' but the argument
has
      type 'size_t' (aka 'unsigned long') [-Wformat]

*                    "8bit chars: %d / %d (%f%%)\n", octet_chars,
total_len,*could be changed to the following ot suppress the warning


*                    "8bit chars: %zu / %zu (%f%%)\n", octet_chars,
total_len,*utils.c:4222:16: warning: passing 'const gchar *[3]' to
parameter of type
      'gchar *const *' (aka 'char *const *') discards qualifiers in nested
      pointer types [-Wincompatible-pointer-types-discards-qualifiers]

*        execute_async(argv);*
could be changed to the following to suppress the warning


*execute_async((gchar *const *)argv);*virtual.c:119:2: warning: implicit
conversion from enumeration type
      'SpecialFolderItemType' to different enumeration type 'FolderType'
      [-Wenum-conversion]

*        F_VIRTUAL,*
this looks like a potential bug; but I don't know whether the type in the
class should be changed or if F_VIRTUAL should be cast to FolderType

mainwindow.c:2102:12: warning: comparison of constant -1 with expression of
type
      'GtkToolbarStyle' is always true
      [-Wtautological-constant-out-of-range-compare]

*        if (style != -1) {*
could be changed to the following to suppress the warning


*        if (style != (GtkToolbarStyle) -1) {*summaryview.c:2339:15:
warning: comparison of constant -1 with expression of type
      'SummaryColumnType' is always false
      [-Wtautological-constant-out-of-range-compare]

*        if (col_type == -1) {*could be changed to the following to
suppress the warning


*        if (col_type == (SummaryColumnType) -1) {*summaryview.c:2358:20:
warning: comparison of constant -1 with expression of type
      'SummaryColumnType' is always true
      [-Wtautological-constant-out-of-range-compare]

*        if (prev_col_type != -1 && col_type != prev_col_type &&*could be
changed to the following to suppress the warning


*        if (prev_col_type != (SummaryColumnType) -1 && col_type !=
prev_col_type &&*summaryview.c:5632:12: warning: comparison of unsigned
enum expression < 0 is
      always false [-Wtautological-compare]

*                if (type < 0 || type >= N_SUMMARY_VISIBLE_COLS) {*could be
changed to the following to suppress the warning


*                if ((int) type < 0 || type >= N_SUMMARY_VISIBLE_COLS)
{*compose.c:6064:12:
warning: comparison of constant -1 with expression of type
      'GtkToolbarStyle' is always true
      [-Wtautological-constant-out-of-range-compare]

*        if (style != -1) {*could be changed to the following to suppress
the warning


*        if (style != (GtkToolbarStyle) -1) {*prefs_account_dialog.c:2490:7:
warning: case value not in enumerated type
      'IMAPAuthType' [-Wswitch]

*        case 0:*could be changed to the following to suppress the warning


*switch ((int) type) {*prefs_account_dialog.c:2543:7: warning: case value
not in enumerated type
      'SMTPAuthType' [-Wswitch]

*        case 0:*could be changed to the following to suppress the warning


*switch ((int) type) {*prefs_folder_item.c:467:13: warning: comparison of
unsigned expression < 0 is
      always false [-Wtautological-compare]

*if (index < 0)*could be changed to the following to suppress the warning


*gint index = 0;*prefs_summary_column.c:381:23: warning: comparison of
constant -1 with expression
      of type 'SummaryColumnType' is always true
      [-Wtautological-constant-out-of-range-compare]

*    state[pos].type != -1) {*could be changed to the following to suppress
the warning
















































*    state[pos].type != (SummaryColumnType) -1) {rpop3.c:651:34: warning:
comparison of constant 1021 with expression of type      'Pop3State' is
always false [-Wtautological-constant-out-of-range-compare]        if
(rpop3_window.session->state == POP3_IDLE)
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~rpop3.c:946:7: warning: case value
not in enumerated type 'Pop3State' [-Wswitch]        case
POP3_TOP:             ^rpop3.c:64:18: note: expanded from macro
'POP3_TOP'#define POP3_TOP        (N_POP3_STATE +
1000)                        ^rpop3.c:970:7: warning: case value not in
enumerated type 'Pop3State' [-Wswitch]        case POP3_NOOP:
^rpop3.c:66:19: note: expanded from macro 'POP3_NOOP'#define
POP3_NOOP       (N_POP3_STATE + 1002)
^rpop3.c:1078:7: warning: case value not in enumerated type 'Pop3State'
[-Wswitch]        case POP3_TOP_RECV:             ^rpop3.c:65:23: note:
expanded from macro 'POP3_TOP_RECV'#define POP3_TOP_RECV   (N_POP3_STATE +
1001)                        ^rpop3.c:1162:34: warning: comparison of
constant 1021 with expression of type      'Pop3State' is always true
[-Wtautological-constant-out-of-range-compare]        if
(rpop3_window.session->state != POP3_IDLE)
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~rpop3.c:1202:34: warning:
comparison of constant 1021 with expression of type      'Pop3State' is
always true [-Wtautological-constant-out-of-range-compare]        if
(rpop3_window.session->state != POP3_IDLE)
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~rpop3.c:1239:34: warning:
comparison of constant 1021 with expression of type      'Pop3State' is
always true [-Wtautological-constant-out-of-range-compare]        if
(rpop3_window.session->state != POP3_IDLE)
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~rpop3.c:1284:34: warning:
comparison of constant 1021 with expression of type      'Pop3State' is
always true [-Wtautological-constant-out-of-range-compare]        if
(rpop3_window.session->state != POP3_IDLE)
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~rpop3.c:1313:34: warning:
comparison of constant 1021 with expression of type      'Pop3State' is
always false [-Wtautological-constant-out-of-range-compare]        if
(rpop3_window.session->state == POP3_IDLE)
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~rpop3.c:1323:34: warning:
comparison of constant 1021 with expression of type      'Pop3State' is
always false [-Wtautological-constant-out-of-range-compare]        if
(rpop3_window.session->state == POP3_IDLE) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~*
could be fixed by changing the following in pop.h and commenting out the
#define's for the above "enum" values
    N_POP3_STATE,
    POP3_TOP = (N_POP3_STATE + 1000),
    POP3_TOP_RECV = (N_POP3_STATE + 1001),
    POP3_NOOP = (N_POP3_STATE + 1002),
    POP3_IDLE = (N_POP3_STATE + 1003)

I don't expect most of the above changes to modify operation (except for
the ones that I identify as "bugs').  Do with these comments what you will
and thanks for the diligent work on the awesome program that is sylpheed.

Bill

On Thu, Jun 29, 2017 at 4:26 AM, Hiroyuki Yamamoto <hiro-y at kcn.ne.jp> wrote:

> Hello,
>
> The new stable version Sylpheed 3.6 has been released.
>
> http://sylpheed.sraoss.jp/en/news.html
> http://sylpheed.sraoss.jp/en/download.html
>
> In this release, the feature to use multiple signatures in one account,
> open configuration folder and save printing settings were added. Some
> UI improvements and bugfixes were also made.
>
> Changes since 3.5.1:
>
>   * The feature to use multiple signatures in one account was added.
>   * The edit group dialog of the address book was improved to allow
>     multilple selection and display its available list with folder tree.
>   * The menu 'Tools - Open configuration/attachments folder' was added.
>   * Printing settings and page setup are now saved.
>   * The Japanese manual was updated.
>   * IMAP: SUBSCRIBE command is explicitly issued for a newly created
>     folder by CREATE.
>   * Unix: the search location of SSL certificates for OpenBSD was added
>     (#222).
>   * Win32: a notice about not removing user data in the installer was
>     modified.
>   * Win32: OpenSSL was updated to 1.0.2l.
>
> Changes since 3.6beta1:
>
>   * The Japanese manual was updated.
>   * Win32: OpenSSL was updated to 1.0.2l.
>
> --
> Hiroyuki Yamamoto <hiro-y at kcn.ne.jp>
>


More information about the Sylpheed mailing list