Bug 268208 - mail/mutt: fix build with clang 15
Summary: mail/mutt: fix build with clang 15
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks: 265425
  Show dependency treegraph
 
Reported: 2022-12-06 20:59 UTC by Dimitry Andric
Modified: 2022-12-07 15:57 UTC (History)
1 user (show)

See Also:
dereks: maintainer-feedback+


Attachments
mail/mutt: fix build with clang 15 (2.94 KB, patch)
2022-12-06 21:00 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2022-12-06 20:59:39 UTC
During an exp-run for llvm 15 (see bug 265425), it turned out that mail/mutt failed to build with clang 15:

    --- init.o ---
    In file included from init.c:43:
    ./init.h:3166:37: error: incompatible integer to pointer conversion initializing 'void *' with an expression of type 'int' [-Wint-conversion]
      { "quote_empty",      DT_BOOL, R_NONE, OPTQUOTEEMPTY, 1 },
                                             ^~~~~~~~~~~~~
    ./init.h:3166:37: warning: suggest braces around initialization of subobject [-Wmissing-braces]
      { "quote_empty",      DT_BOOL, R_NONE, OPTQUOTEEMPTY, 1 },
                                             ^~~~~~~~~~~~~
                                             {            }
    ./init.h:3166:52: error: incompatible integer to pointer conversion initializing 'void *' with an expression of type 'int' [-Wint-conversion]
      { "quote_empty",      DT_BOOL, R_NONE, OPTQUOTEEMPTY, 1 },
                                                            ^
    ./init.h:3166:52: warning: suggest braces around initialization of subobject [-Wmissing-braces]
      { "quote_empty",      DT_BOOL, R_NONE, OPTQUOTEEMPTY, 1 },
                                                            ^

This is because the QUOTE_PATCH option is on by default, and that quote patch does not properly initialize the union members for the MuttVars variable.

I will attach a patch for the quote patch. :)
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2022-12-06 21:00:06 UTC
Created attachment 238584 [details]
mail/mutt: fix build with clang 15
Comment 2 Derek Schrock 2022-12-07 00:45:44 UTC
As a temp. fix this looks good.  Maybe I'll contact http://vc.org.ua/mutt/ to see if they want to add this to the currently maintained quote patch.
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2022-12-07 15:14:24 UTC
(In reply to Derek Schrock from comment #2)

FWIW, the conversion of MuttVars to contain unions for the data and init members was done quite some time ago, in 2019:

https://gitlab.com/muttmua/mutt/-/commit/5bf53035591695994c3f01b36a4f6d87c903a061

But it looks like the quote patch was forgotten.
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-12-07 15:36:06 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=de5264ca78f41c04c1753ca94d949121b53b9f1d

commit de5264ca78f41c04c1753ca94d949121b53b9f1d
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-12-06 20:53:39 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-12-07 15:34:04 +0000

    mail/mutt: fix build with clang 15

    During an exp-run for llvm 15 (see bug 265425), it turned out that
    mail/mutt failed to build with clang (and lld) 15:

      --- init.o ---
      In file included from init.c:43:
      ./init.h:3166:37: error: incompatible integer to pointer conversion initializing 'void *' with an expression of type 'int' [-Wint-conversion]
        { "quote_empty",      DT_BOOL, R_NONE, OPTQUOTEEMPTY, 1 },
                                               ^~~~~~~~~~~~~
      ./init.h:3166:37: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        { "quote_empty",      DT_BOOL, R_NONE, OPTQUOTEEMPTY, 1 },
                                               ^~~~~~~~~~~~~
                                               {            }
      ./init.h:3166:52: error: incompatible integer to pointer conversion initializing 'void *' with an expression of type 'int' [-Wint-conversion]
        { "quote_empty",      DT_BOOL, R_NONE, OPTQUOTEEMPTY, 1 },
                                                              ^
      ./init.h:3166:52: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        { "quote_empty",      DT_BOOL, R_NONE, OPTQUOTEEMPTY, 1 },
                                                              ^

    This is because the QUOTE_PATCH option is on by default, and that quote
    patch does not properly initialize the union members for the MuttVars
    variable.

    PR:             268208
    Approved by:    dereks@lifeofadishwasher.com (maintainer)
    MFH:            2022Q4

 mail/mutt/Makefile                      |  1 +
 mail/mutt/files/extra-patch-quote (new) | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)