Tuesday, April 30, 2019

Re: [ports-gcc-8] Unbreak multimedia/libmp4v2

On Mon, 29 Apr 2019 23:59:03 +0200
Christian Weisgerber <naddy@mips.inka.de> wrote:

> Charlene Wendling:
>
> > > > src/cmeta.cpp:1386:16: error: converting to 'bool' from
> > > > 'std::nullptr_t' requires direct-initialization [-fpermissive]
> > > > return NULL;
>
> If that's the only problem, then these could just be fixed by
> changing them to "return false".

TL;DR: i can't get libmp4v2 build with C++14.

Thanks for this one. There are a lot of them actually: mostly
narrowing to int errors, there is an integer overflow somewhere
i guess, but i can't find it, for example:

util/mp4art.cpp:378:14: error: case value evaluates to 4026531846,
which cannot be narrowed to type 'int' [-Wc++11-narrowing]
Repeated on lines 378, 382, 391, 395, 402, 406, 413

Using long [0] instead of int (badly) solves these errors, but then
the documentation cannot be generated, because it break long options
management (they've rolled their own...), so the build never
finishes.

I also considered updating the port, but the current code is
similar.

FreeBSD disables -Wc++11-narrowing, but it only hides the issue afaik.


> > > Again, it breaks because it wants C++<11.
> >
> > -.include <bsd.port.arch.mk>
> > -.if ${PROPERTIES:Mclang}
> > CXXFLAGS += -std=c++03
> > -.endif
>
> That really needs a #comment.
>
> Now when I see a naked -std=c++*, I don't know if its purpose is/was
> to switch an old compiler to a higher C++ standard, or to limit a
> new compiler to an older standard.

Especially that context may change in this regard, i'm pleading guilty.

I'm proposing this, what do you think about it?

> --
> Christian "naddy" Weisgerber
> naddy@mips.inka.de
>

Charlène.


[0] https://github.com/sergiomb2/libmp4v2/issues/163


Index: Makefile
===================================================================
RCS file: /cvs/ports/multimedia/libmp4v2/Makefile,v
retrieving revision 1.19
diff -u -p -u -p -r1.19 Makefile
--- Makefile 29 Apr 2019 11:38:17 -0000 1.19
+++ Makefile 1 May 2019 00:17:13 -0000
@@ -27,6 +27,9 @@ USE_GMAKE = Yes
MAKE_FILE = GNUmakefile
CONFIGURE_STYLE = gnu

+# As of mp4v2-1.9.1, the code is written for c++03, using c++>=11 causes too
+# many narrowing to int issues in a roll-your-own option management, among
+# others.
CXXFLAGS += -std=c++03

.include <bsd.port.mk>

No comments:

Post a Comment