Opened 12 months ago

#59201 assigned defect

smpeg2: constant expression evaluates to -1 which cannot be narrowed to type 'unsigned int'

Reported by: ryandesign (Ryan Schmidt) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.6.1
Keywords: Cc:
Port: smpeg2

Description

smpeg2 doesn't build with clang 8:

audio/hufftable.cpp:553:8: error: constant expression evaluates to -1 which cannot be narrowed to type 'unsigned int' [-Wc++11-narrowing]
  { 0, 0-1, 0-1, 0,  0, htd33},
       ^~~
audio/hufftable.cpp:553:8: note: insert an explicit cast to silence this issue
  { 0, 0-1, 0-1, 0,  0, htd33},
       ^~~
       static_cast<unsigned int>( )

This is the same problem I saw with smpeg, which I fixed in [cdbb43d3a440b88669276857743ada7a85065a0d/macports-ports] by following FreeBSD's lead and setting the language standard back to an earlier version that doesn't complain about this, but the same fix does not work on smpeg2, because smpeg2 does not honor the CXXFLAGS the port sets. Of course this is a problem for other reasons too, like not using the specified C++ standard library.

The smpeg port has many patches which fix the build system to honor our flags. The smpeg2 port seems to be missing these.

Change History (0)

Note: See TracTickets for help on using tickets.