Bug 268795 - x11/mate-panel: fix build with clang 15
Summary: x11/mate-panel: 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-gnome (Nobody)
URL:
Keywords:
Depends on:
Blocks: 265425
  Show dependency treegraph
 
Reported: 2023-01-07 00:32 UTC by Dimitry Andric
Modified: 2023-01-16 19:07 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (gnome)


Attachments
x11/mate-panel: fix build with clang 15 (2.10 KB, patch)
2023-01-07 00:32 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 2023-01-07 00:32:06 UTC
During an exp-run for llvm 15 (see bug 265425), it turned out that x11/mate-panel failed to build with clang 15:

  clock-location.c:454:22: error: incompatible pointer to integer conversion assigning to 'glong' (aka 'long') from 'char *(int, int)' [-Wint-conversion]
          sys_timezone = timezone;
                       ^ ~~~~~~~~
  clock-location.c:462:24: error: incompatible pointer to integer conversion assigning to 'glong' (aka 'long') from 'char *(int, int)' [-Wint-conversion]
          local_timezone = timezone;
                         ^ ~~~~~~~~

This is because 'timezone' as a global external variable does not exist on FreeBSD: it is a glibc-ism. Use struct tm's tm_gmtoff field instead, which has its sign reversed from the glibc global. There is also no need to manually account for DST, as tm_gmtoff includes that.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-01-07 00:32:24 UTC
Created attachment 239315 [details]
x11/mate-panel: fix build with clang 15
Comment 2 Ed Maste freebsd_committer freebsd_triage 2023-01-16 13:26:19 UTC
We ought to submit this to https://github.com/mate-desktop/mate-panel also
Comment 3 Ed Maste freebsd_committer freebsd_triage 2023-01-16 13:33:39 UTC
(In reply to Ed Maste from comment #2)
I submitted a bug report https://github.com/mate-desktop/mate-panel/issues/1350
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-01-16 19:06:20 UTC
A commit in branch main references this bug:

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

commit ca9de74ce4b13b979ea5f24c88c111a2f9b24dfa
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-01-07 00:28:09 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-01-16 19:04:46 +0000

    x11/mate-panel: fix build with clang 15

    During an exp-run for llvm 15 (see bug 265425), it turned out that
    x11/mate-panel failed to build with clang 15:

      clock-location.c:454:22: error: incompatible pointer to integer conversion assigning to 'glong' (aka 'long') from 'char *(int, int)' [-Wint-conversion]
              sys_timezone = timezone;
                           ^ ~~~~~~~~
      clock-location.c:462:24: error: incompatible pointer to integer conversion assigning to 'glong' (aka 'long') from 'char *(int, int)' [-Wint-conversion]
              local_timezone = timezone;
                             ^ ~~~~~~~~

    This is because 'timezone' as a global external variable does not exist
    on FreeBSD: it is a glibc-ism. Use struct tm's tm_gmtoff field instead,
    which has its sign reversed from the glibc global. There is also no need
    to manually account for DST, as tm_gmtoff includes that.

    PR:             268795
    Approved by:    portmgr (tcberner)
    MFH:            2023Q1

 .../patch-applets_clock_clock-location.c (new)     | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)