Re: [MacPorts] #70170: ctpv @1.1: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’

MacPorts noreply at macports.org
Sat Oct 12 19:25:51 UTC 2024


#70170: ctpv @1.1: error: expected ‘;’, ‘,’ or ‘)’ before ‘__VA_OPT__’
---------------------------+-------------------------
  Reporter:  barracuda156  |      Owner:  suhailskhan
      Type:  defect        |     Status:  reopened
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:  2.9.3
Resolution:                |   Keywords:
      Port:  ctpv          |
---------------------------+-------------------------

Comment (by suhailskhan):

 Replying to [comment:11 barracuda156]:
 > Replying to [comment:10 suhailskhan]:
 > > >Blacklisting old compilers is not necessarily the solution we want.
 For example, if the only problem is that this code needs C99, then gcc 4.2
 supports C99 and should simply be instructed to use it via the -std=c99 or
 -std=gnu99 flag.
 > >
 > > After looking more into this, I found that `__VA_OPT__` is a C23/C++20
 feature.
 > >
 > > Replacing the `compiler.blacklist-append` line with
 `compiler.cxx_standard 2020` may be the correct solution. It fixes the
 build when I tested it on Snow Leopard, and hopefully should for Leopard
 and preview builds of Snow Leopard as well. I tried using
 `compiler.c_standard 2023` as well, but the build failed.
 >
 > If it uses modern C++ specifically, then portfile must have
 `compiler.cxx_standard`, blacklist won’t work correctly (since C++
 standard does more than compiler choice).

 I initially took the blacklist approach because I noticed the build would
 fail on Big Sur, whose final Xcode release was 13.2.1. For systems with
 Xcode 14 and above, Xcode’s clang was able to build the port successfully.
 At the time, I was not concerned with the actual root cause, but figured
 blacklisting clang with build numbers below 1400 (i.e. builds shipped with
 Xcode prior to Xcode 14) would be a sufficient solution.

 This successfully resolved the build issue for Big Sur, as well as prior
 releases all the way down to Lion. I did notice it would still fail for
 Leopard and Snow Leopard.

 Anyway, pending merge of [https://github.com/macports/macports-
 ports/pull/26139 PR #26139], we will now stop using the blacklist and
 start defining the required language standard.

-- 
Ticket URL: <https://trac.macports.org/ticket/70170#comment:12>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list