Bug 274796 - www/node16 multimedia/phonon (may be others) and clang 16 breakage
Summary: www/node16 multimedia/phonon (may be others) and clang 16 breakage
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Juraj Lutter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-29 17:33 UTC by Dave Hayes
Modified: 2023-10-29 19:40 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Hayes 2023-10-29 17:33:10 UTC
To fix the clang  16 breakage, some have written this:

.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1400091
CXXFLAGS+=      -Wno-error=enum-constexpr-conversion
.endif

Since 13-STABLE recently (or at some point) got clang 16, this conditional prevents compilation of these ports on recent 13-STABLE. 

Some others have written this:

.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 160 && ${ARCH} == aarch64
CXXFLAGS+=      -Wno-error=enum-constexpr-conversion
.endif

I think the second one is the more correct solution, since it does not depend on OS version. Hence this bug report.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-10-29 18:44:32 UTC
The correct solution is of course to fix the actual out-of-range enums, not to suppress the warning. :)

That is what I did in the original patch for bug 272013. It also fixes the AddressingMode warning by changing its declaration to "enum AddressingMode : uint8_t".
Comment 2 Dave Hayes 2023-10-29 19:40:25 UTC
Many levels of correctness for this level of complexity is not unheard of. I agree with you of course; I can't think of a valid reason that an enum would be set out of range (which doesn't mean there isn't one). 

For several weeks now I have been trying to get different versions of the OS (12 and 13 only tho) to build the same set of ports consistently. So for my goal, I have learned that he conditional that uses COMPILER_TYPE needs some USES=compiler declaration, so I have instead opted to do this: 

.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1302508

It's probably not as correct as it can be, but it seems to work.

I would love to hear a more correct solution that doesn't involve a lot of devs doing a lot of work.