svn commit: r458456 - in head/x11-toolkits/gtkmm20: . files

Jan Beich jbeich at FreeBSD.org
Mon Jan 8 17:07:42 UTC 2018


Author: jbeich
Date: Mon Jan  8 17:07:41 2018
New Revision: 458456
URL: https://svnweb.freebsd.org/changeset/ports/458456

Log:
  x11-toolkits/gtkmm20: unbreak build with Clang 6 (C++14 by default)
  
  In file included from module.cc:3:
  ../../glib/glibmm/module.h:30:1: error: no member named 'string' in the global namespace; did you mean '::std::string'?
  GTKMM_USING_STD(string)
  ^~~~~~~~~~~~~~~~~~~~~~~
  ../../glib/glibmmconfig.h:60:57: note: expanded from macro 'GTKMM_USING_STD'
   #  define GTKMM_USING_STD(Symbol) namespace std { using ::Symbol; }
                                                           ^~
  /usr/include/c++/v1/iosfwd:194:65: note: '::std::string' declared here
  typedef basic_string<char, char_traits<char>, allocator<char> > string;
                                                                  ^
  class.cc:40:5: error: non-constant-expression cannot be narrowed from type 'guint'
        (aka 'unsigned int') to 'guint16' (aka 'unsigned short') in initializer list
        [-Wc++11-narrowing]
      base_query.class_size,
      ^~~~~~~~~~~~~~~~~~~~~
  class.cc:40:5: note: insert an explicit cast to silence this issue
      base_query.class_size,
      ^~~~~~~~~~~~~~~~~~~~~
      static_cast<guint16>()
  [...]
  
  Reported by:	antoine (via bug 224669)
  Obtained from:	upstream (glibmm 2.31.2)
  Suggested by:	tijl (autoreconf)

Added:
  head/x11-toolkits/gtkmm20/files/patch-glib_glibmm_class.cc   (contents, props changed)
Deleted:
  head/x11-toolkits/gtkmm20/files/patch-gdk__gdkmm__Makefile.in
  head/x11-toolkits/gtkmm20/files/patch-gtk__gtkmm__Makefile.in
Modified:
  head/x11-toolkits/gtkmm20/Makefile   (contents, props changed)

Modified: head/x11-toolkits/gtkmm20/Makefile
==============================================================================
--- head/x11-toolkits/gtkmm20/Makefile	Mon Jan  8 17:07:21 2018	(r458455)
+++ head/x11-toolkits/gtkmm20/Makefile	Mon Jan  8 17:07:41 2018	(r458456)
@@ -22,7 +22,7 @@ PORTSCOUT=	ignore:1
 LIB_DEPENDS=	libsigc-1.2.so:devel/libsigc++12
 BUILD_DEPENDS=	gm4:devel/m4
 
-USES+=		gmake libtool:keepla pathfix pkgconfig
+USES+=		autoreconf gmake libtool:keepla pathfix pkgconfig
 GNU_CONFIGURE=	yes
 USE_LDCONFIG=	yes
 USE_GNOME=	gtk20
@@ -39,7 +39,8 @@ post-patch:
 		${WRKSRC}/glib/glibmm/*.cc ${WRKSRC}/glib/glibmm/*.h \
 		${WRKSRC}/gtk/gtkmm/textbuffer.cc
 .for d in docs examples tests
-	@${REINPLACE_CMD} -e '/^SUBDIRS =/s/${d}//' ${WRKSRC}/Makefile.in
+	@${REINPLACE_CMD} -e '/^SUBDIRS[[:space:]]*=/s/${d}//' \
+		${WRKSRC}/Makefile.am
 .endfor
 
 .include <bsd.port.mk>

Added: head/x11-toolkits/gtkmm20/files/patch-glib_glibmm_class.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11-toolkits/gtkmm20/files/patch-glib_glibmm_class.cc	Mon Jan  8 17:07:41 2018	(r458456)
@@ -0,0 +1,93 @@
+class.cc:40:5: error: non-constant-expression cannot be narrowed from type 'guint'
+      (aka 'unsigned int') to 'guint16' (aka 'unsigned short') in initializer list
+      [-Wc++11-narrowing]
+    base_query.class_size,
+    ^~~~~~~~~~~~~~~~~~~~~
+class.cc:40:5: note: insert an explicit cast to silence this issue
+    base_query.class_size,
+    ^~~~~~~~~~~~~~~~~~~~~
+    static_cast<guint16>()
+class.cc:46:5: error: non-constant-expression cannot be narrowed from type 'guint'
+      (aka 'unsigned int') to 'guint16' (aka 'unsigned short') in initializer list
+      [-Wc++11-narrowing]
+    base_query.instance_size,
+    ^~~~~~~~~~~~~~~~~~~~~~~~
+class.cc:46:5: note: insert an explicit cast to silence this issue
+    base_query.instance_size,
+    ^~~~~~~~~~~~~~~~~~~~~~~~
+    static_cast<guint16>(   )
+class.cc:78:7: error: non-constant-expression cannot be narrowed from type 'guint'
+      (aka 'unsigned int') to 'guint16' (aka 'unsigned short') in initializer list
+      [-Wc++11-narrowing]
+      base_query.class_size,
+      ^~~~~~~~~~~~~~~~~~~~~
+class.cc:78:7: note: insert an explicit cast to silence this issue
+      base_query.class_size,
+      ^~~~~~~~~~~~~~~~~~~~~
+      static_cast<guint16>()
+class.cc:84:7: error: non-constant-expression cannot be narrowed from type 'guint'
+      (aka 'unsigned int') to 'guint16' (aka 'unsigned short') in initializer list
+      [-Wc++11-narrowing]
+      base_query.instance_size,
+      ^~~~~~~~~~~~~~~~~~~~~~~~
+class.cc:84:7: note: insert an explicit cast to silence this issue
+      base_query.instance_size,
+      ^~~~~~~~~~~~~~~~~~~~~~~~
+      static_cast<guint16>(   )
+
+https://git.gnome.org/browse/glibmm/commit/?id=926909ed02a2
+
+--- glib/glibmm/class.cc.orig	2002-10-11 18:05:43 UTC
++++ glib/glibmm/class.cc
+@@ -35,15 +35,23 @@ void Class::register_derived_type(GType base_type)
+   GTypeQuery base_query = { 0, 0, 0, 0, };
+   g_type_query(base_type, &base_query);
+ 
++  //GTypeQuery::class_size is guint but GTypeInfo::class_size is guint16.
++  const guint16 class_size =
++   (guint16)base_query.class_size;
++
++  //GTypeQuery::instance_size is guint but GTypeInfo::instance_size is guint16.
++  const guint16 instance_size =
++   (guint16)base_query.instance_size;
++ 
+   const GTypeInfo derived_info =
+   {
+-    base_query.class_size,
++    class_size,
+     0, // base_init
+     0, // base_finalize
+     class_init_func_,
+     0, // class_finalize
+     0, // class_data
+-    base_query.instance_size,
++    instance_size,
+     0, // n_preallocs
+     0, // instance_init
+     0, // value_table
+@@ -73,15 +81,23 @@ GType Class::clone_custom_type(const char* custom_type
+     GTypeQuery base_query = { 0, 0, 0, 0, };
+     g_type_query(base_type, &base_query);
+ 
++    //GTypeQuery::class_size is guint but GTypeInfo::class_size is guint16.
++    const guint16 class_size =
++      (guint16)base_query.class_size;
++
++    //GTypeQuery::instance_size is guint but GTypeInfo::instance_size is guint16.
++    const guint16 instance_size =
++      (guint16)base_query.instance_size;
++
+     const GTypeInfo derived_info =
+     {
+-      base_query.class_size,
++      class_size,
+       0, // base_init
+       0, // base_finalize
+       &Class::custom_class_init_function,
+       0, // class_finalize
+       this, // class_data
+-      base_query.instance_size,
++      instance_size,
+       0, // n_preallocs
+       0, // instance_init
+       0, // value_table


More information about the svn-ports-all mailing list