Bug 182906 - audio/taglib .h files not c++ pedantic clean, breaks audio/soundkonverter (mp4coverart.h:49: error: comma at end of enumerator list)
Summary: audio/taglib .h files not c++ pedantic clean, breaks audio/soundkonverter (mp...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Jason E. Hale
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-11 16:30 UTC by Mark.Martinec
Modified: 2015-03-15 22:00 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark.Martinec 2013-10-11 16:30:00 UTC
Building of port audio/soundkonverter fails because it tries to include a
file /usr/local/include/taglib/mp4coverart.h (installed by port audio/taglib)
using a c++ compiler with a -pedantic option enabled:

In file included from /usr/local/include/taglib/mp4item.h:31,
                 from /usr/local/include/taglib/mp4tag.h:37,
                 from /wrkdirs/usr/ports/audio/soundkonverter/work/soundkonverter-2.0.4/metadata/tagengine.cpp:32:
/usr/local/include/taglib/mp4coverart.h:49: error: comma at end of enumerator list
*** [CMakeFiles/soundkonverter.dir/metadata/tagengine.o] Error code 1


Sure enough, there is a trailing comma there
in /usr/local/include/taglib/mp4coverart.h near line 49:

      enum Format {
        JPEG    = TypeJPEG,
        PNG     = TypePNG,
        BMP     = TypeBMP,
        GIF     = TypeGIF,
        Unknown = TypeImplicit,
      };


Using system default compiler: c++ (GCC) 4.2.1 20070831 patched [FreeBSD].
Fresh versions from ports: audio/soundkonverter 2.0.4, audio/taglib 1.9.1.
Full build log at: http://www.ijs.si/usr/mark/tmp/soundkonverter-2.0.4.log

The 'comma at end of enumerator' is not valid in C++ (nor in C89),
although it is valid in C99. Apparently it becomes valid in C++11,
but we are not there yet.

Fix: 

Depending on a point of view, the error is either in the exported .h file(s)
by a port audio/taglib, or in using a -pedantic option in audio/soundkonverter
which tries to include plain C include files from a C++ code.

Perhaps the least effort solution would be to drop -pedantic from
C++ options in port audio/soundkonverter .

A cleaner solution would be to drop trailing commas in .h files
as installed by port audio/taglib, in particular the mp4coverart.h file.
How-To-Repeat: Build audio/soundkonverter from ports.
Comment 1 Edwin Groothuis freebsd_committer 2013-10-11 16:30:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->jhale

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer 2013-11-24 08:56:52 UTC
Author: dbn
Date: Sun Nov 24 08:56:44 2013
New Revision: 334711
URL: http://svnweb.freebsd.org/changeset/ports/334711

Log:
  Fix build of audio/soundkonverter due to the use of '-pedantic'.
  
  Soundkonverter includes a C file that has a trailing comma (,) at the end
  of an enum, this construct is only supported by C++11 (but by C99) thus is
  not accepted as valid with the '-pedantic'.  The base compiler (gcc) does
  not understand C++11 and errors on this.
  
  Remove the '-pedantic' option as it does not impact on the code produced,
  to allow the port to be built.
  
  PR:	ports/182906

Modified:
  head/audio/soundkonverter/Makefile

Modified: head/audio/soundkonverter/Makefile
==============================================================================
--- head/audio/soundkonverter/Makefile	Sun Nov 24 08:28:43 2013	(r334710)
+++ head/audio/soundkonverter/Makefile	Sun Nov 24 08:56:44 2013	(r334711)
@@ -108,4 +108,7 @@ WAVPACK_RUN_DEPENDS=	wavpack:${PORTSDIR}
 NLS_USES=	gettext
 NLS_CMAKE_OFF=	-DBUILD_po=FALSE
 
+post-patch:
+	${REINPLACE_CMD} "/-pedantic/d" ${WRKSRC}/CMakeLists.txt
+
 .include <bsd.port.mk>
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Bartek Rutkowski freebsd_committer 2015-03-15 22:00:34 UTC
This issue has been fixed in commit ages ago, so I am closing this PR.