Bug 282475 - devel/protozero: fix build with clang 19
Summary: devel/protozero: fix build with clang 19
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: Dmitry Marakasov
URL:
Keywords:
Depends on:
Blocks: 280562
  Show dependency treegraph
 
Reported: 2024-11-01 18:17 UTC by Dimitry Andric
Modified: 2024-11-08 16:07 UTC (History)
0 users

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


Attachments
devel/protozero: fix build with clang 19 (4.17 KB, patch)
2024-11-01 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 2024-11-01 18:17:47 UTC
Clang 19 has become more strict about C++ extensions, which results in:

  /wrkdirs/usr/ports/devel/protozero/work/protozero-1.7.1/test/t/bool/writer_test_cases.cpp:8:1: error: passing no argument for the '...' parameter of a variadic macro is a C++20 extension [-Werror,-Wc++20-extensions]
      8 | TEMPLATE_TEST_CASE("write bool field and check with libprotobuf", "",
        | ^
  /wrkdirs/usr/ports/devel/protozero/work/protozero-1.7.1/test/catch/catch.hpp:17714:35: note: expanded from macro 'TEMPLATE_TEST_CASE'
   17714 | #define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
         |                                   ^
  /wrkdirs/usr/ports/devel/protozero/work/protozero-1.7.1/test/catch/catch.hpp:1118:9: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_TEST_CASE'
   1118 |         INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_ ), INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_M_P_L_A_T_E_T_E_S_T_F_U_N_C_ ), Name, Tags, typename TestType, __VA_ARGS__ )
        |         ^
  /wrkdirs/usr/ports/devel/protozero/work/protozero-1.7.1/test/catch/catch.hpp:1096:13: note: expanded from macro 'INTERNAL_CATCH_TEMPLATE_TEST_CASE_2'
   1096 |             INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature))\
        |             ^
  /wrkdirs/usr/ports/devel/protozero/work/protozero-1.7.1/test/catch/catch.hpp:897:465: note: expanded from macro 'INTERNAL_CATCH_NTTP_GEN'
    897 | #define INTERNAL_CATCH_NTTP_GEN(...) INTERNAL_CATCH_VA_NARGS_IMPL(__VA_ARGS__, INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1( __VA_ARGS__), INTERNAL_CATCH_NTTP_1( __VA_ARGS__), INTERNAL_CATCH_NTTP_1( __VA_ARGS__), INTERNAL_CATCH_NTTP_1( __VA_ARGS__),INTERNAL_CATCH_NTTP_1( __VA_ARGS__), INTERNAL_CATCH_NTTP_0)
        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ^
  /wrkdirs/usr/ports/devel/protozero/work/protozero-1.7.1/test/catch/catch.hpp:780:9: note: macro 'INTERNAL_CATCH_VA_NARGS_IMPL' defined here
    780 | #define INTERNAL_CATCH_VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N
        |         ^

This can be fixed by patching catch.hpp so it uses the correct pragma to
suppress this warning, for clang >= 19.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2024-11-01 18:18:48 UTC
Created attachment 254853 [details]
devel/protozero: fix build with clang 19
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-11-08 16:07:55 UTC
A commit in branch main references this bug:

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

commit a4be34bc81a30016a9a7eb22ae0509fb505775ee
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2024-11-08 15:31:50 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2024-11-08 15:34:00 +0000

    devel/protozero: fix build with clang 19

    PR:             282475
    Submitted by:   dim

 devel/protozero/files/patch-test_catch_catch.hpp (new) | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)