Bug 268864 - science/silo: fix build with clang 15
Summary: science/silo: 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: Dimitry Andric
URL:
Keywords:
Depends on:
Blocks: 265425
  Show dependency treegraph
 
Reported: 2023-01-10 18:18 UTC by Dimitry Andric
Modified: 2023-01-10 18:29 UTC (History)
1 user (show)

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


Attachments
science/silo: fix build with clang 15 (4.10 KB, patch)
2023-01-10 18:18 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-10 18:18:34 UTC
During an exp-run for llvm 15 (see bug 265425), it turned out that science/silo failed to build with clang 15:

  /wrkdirs/usr/ports/science/silo/work/Silo-4.11-68-g819658e/src/hdf5_drv/silo_hdf5.c:1869:13: error: incompatible integer to pointer conversion passing 'char' to parameter of type 'const char *'; take the address with & [-Wint-conversi
              DB_OBJ_CASE(DB_CURVE, DBcurve_mt, npts?1:1, yvarname)
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /wrkdirs/usr/ports/science/silo/work/Silo-4.11-68-g819658e/src/hdf5_drv/silo_hdf5.c:1812:36: note: expanded from macro 'DB_OBJ_CASE'
              (*dsnames)[i] = strdup(m.MEMNAME[i]);                \
                              ~~~~~~~^~~~~~~~~~~~~
  /wrkdirs/usr/ports/science/silo/work/Silo-4.11-68-g819658e/src/silo/silo_private.h:939:35: note: expanded from macro 'strdup'
  #define strdup(s) _db_safe_strdup(s)
                                    ^
  /wrkdirs/usr/ports/science/silo/work/.build/include/silo.h:2214:68: note: passing argument to parameter here
  SILO_API extern char *                 _db_safe_strdup(const char *);
                                                                     ^

This turns out to be a bug in silo, which I reported upstream in https://github.com/LLNL/Silo/issues/296, and which was fixed in https://github.com/LLNL/Silo/commit/be29ddf.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-01-10 18:18:58 UTC
Created attachment 239384 [details]
science/silo: fix build with clang 15
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2023-01-10 18:20:22 UTC
Approved.
Thanks for the patch.
Please commit it.
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-01-10 18:28:45 UTC
A commit in branch main references this bug:

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

commit 85723e5e46f7acb9f4403aace3b5192dab15c30e
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-01-10 18:15:27 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-01-10 18:26:30 +0000

    science/silo: fix build with clang 15

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

      /wrkdirs/usr/ports/science/silo/work/Silo-4.11-68-g819658e/src/hdf5_drv/silo_hdf5.c:1869:13: error: incompatible integer to pointer conversion passing 'char' to parameter of type 'const char *'; take the address with & [-Wint-conversion]
                  DB_OBJ_CASE(DB_CURVE, DBcurve_mt, npts?1:1, yvarname)
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /wrkdirs/usr/ports/science/silo/work/Silo-4.11-68-g819658e/src/hdf5_drv/silo_hdf5.c:1812:36: note: expanded from macro 'DB_OBJ_CASE'
                  (*dsnames)[i] = strdup(m.MEMNAME[i]);                \
                                  ~~~~~~~^~~~~~~~~~~~~
      /wrkdirs/usr/ports/science/silo/work/Silo-4.11-68-g819658e/src/silo/silo_private.h:939:35: note: expanded from macro 'strdup'
      #define strdup(s) _db_safe_strdup(s)
                                        ^
      /wrkdirs/usr/ports/science/silo/work/.build/include/silo.h:2214:68: note: passing argument to parameter here
      SILO_API extern char *                 _db_safe_strdup(const char *);
                                                                         ^

    This turns out to be a bug in silo, which I reported upstream in
    https://github.com/LLNL/Silo/issues/296, and which was fixed in
    https://github.com/LLNL/Silo/commit/be29ddf.

    PR:             268864
    Approved by:    yuri (maintainer)
    MFH:            2023Q1

 science/silo/files/patch-git-commit-be29ddf (new) | 44 +++++++++++++++++++++++
 1 file changed, 44 insertions(+)