Skip site navigation (1)Skip section navigation (2)
Date:      11 Sep 2012 15:50:44 -0000
From:      Michael Gmelin <freebsd@grem.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        ale@FreeBSD.org
Subject:   ports/171546: [PATCH] databases/mysql55-server: Allow compilation using Clang in C++11 mode
Message-ID:  <20120911155044.70203.qmail@mail.grem.de>
Resent-Message-ID: <201209111600.q8BG0DVN095482@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         171546
>Category:       ports
>Synopsis:       [PATCH] databases/mysql55-server: Allow compilation using Clang in C++11 mode
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 11 16:00:12 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Michael Gmelin
>Release:        FreeBSD 9.1-RC1 amd64
>Organization:
Grem Equity GmbH
>Environment:
System: FreeBSD clangcompile 9.1-RC1 FreeBSD 9.1-RC1 #1 r240177: Fri Sep  7 14:37:21 UTC 2012
>Description:
Those patches add static_cast<int>(...) in various places, since the
implicit type conversation from size_t (return value of my_offsetof)
to int (member offset of struct File_option) is not allowed anymore
when using clang++ -std=c++11.

Since this patch is only relevant at compile time I didn't bump the
PORTREVISION.

Added file(s):
- files/patch-sql-sql__trigger.cc
- files/patch-sql-sql__view.cc

Port maintainer (ale@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99_6 (mode: change, diff: suffix)
>How-To-Repeat:
>Fix:

--- mysql-server-5.5.27.patch begins here ---
diff -ruN --exclude=CVS ../mysql55-server.orig/files/patch-sql-sql__trigger.cc ./files/patch-sql-sql__trigger.cc
--- ../mysql55-server.orig/files/patch-sql-sql__trigger.cc	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-sql-sql__trigger.cc	2012-09-11 17:20:51.102084776 +0200
@@ -0,0 +1,50 @@
+--- sql/sql_trigger.cc.orig	2012-08-02 00:01:13.000000000 +0200
++++ sql/sql_trigger.cc	2012-09-11 17:01:13.000000000 +0200
+@@ -192,32 +192,32 @@ static File_option triggers_file_parameters[]=
+ {
+   {
+     { C_STRING_WITH_LEN("triggers") },
+-    my_offsetof(class Table_triggers_list, definitions_list),
++    static_cast<int>(my_offsetof(class Table_triggers_list, definitions_list)),
+     FILE_OPTIONS_STRLIST
+   },
+   {
+     { C_STRING_WITH_LEN("sql_modes") },
+-    my_offsetof(class Table_triggers_list, definition_modes_list),
++    static_cast<int>(my_offsetof(class Table_triggers_list, definition_modes_list)),
+     FILE_OPTIONS_ULLLIST
+   },
+   {
+     { C_STRING_WITH_LEN("definers") },
+-    my_offsetof(class Table_triggers_list, definers_list),
++    static_cast<int>(my_offsetof(class Table_triggers_list, definers_list)),
+     FILE_OPTIONS_STRLIST
+   },
+   {
+     { C_STRING_WITH_LEN("client_cs_names") },
+-    my_offsetof(class Table_triggers_list, client_cs_names),
++    static_cast<int>(my_offsetof(class Table_triggers_list, client_cs_names)),
+     FILE_OPTIONS_STRLIST
+   },
+   {
+     { C_STRING_WITH_LEN("connection_cl_names") },
+-    my_offsetof(class Table_triggers_list, connection_cl_names),
++    static_cast<int>(my_offsetof(class Table_triggers_list, connection_cl_names)),
+     FILE_OPTIONS_STRLIST
+   },
+   {
+     { C_STRING_WITH_LEN("db_cl_names") },
+-    my_offsetof(class Table_triggers_list, db_cl_names),
++    static_cast<int>(my_offsetof(class Table_triggers_list, db_cl_names)),
+     FILE_OPTIONS_STRLIST
+   },
+   { { 0, 0 }, 0, FILE_OPTIONS_STRING }
+@@ -226,7 +226,7 @@ static File_option triggers_file_parameters[]=
+ File_option sql_modes_parameters=
+ {
+   { C_STRING_WITH_LEN("sql_modes") },
+-  my_offsetof(class Table_triggers_list, definition_modes_list),
++  static_cast<int>(my_offsetof(class Table_triggers_list, definition_modes_list)),
+   FILE_OPTIONS_ULLLIST
+ };
+ 
diff -ruN --exclude=CVS ../mysql55-server.orig/files/patch-sql-sql__view.cc ./files/patch-sql-sql__view.cc
--- ../mysql55-server.orig/files/patch-sql-sql__view.cc	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-sql-sql__view.cc	2012-09-11 17:21:27.769655934 +0200
@@ -0,0 +1,64 @@
+--- sql/sql_view.cc.orig	2012-08-02 00:01:13.000000000 +0200
++++ sql/sql_view.cc	2012-09-11 17:01:13.000000000 +0200
+@@ -730,46 +730,46 @@ static const int required_view_parameters= 14;
+ */
+ static File_option view_parameters[]=
+ {{{ C_STRING_WITH_LEN("query")},
+-  my_offsetof(TABLE_LIST, select_stmt),
++  static_cast<int>(my_offsetof(TABLE_LIST, select_stmt)),
+   FILE_OPTIONS_ESTRING},
+  {{ C_STRING_WITH_LEN("md5")},
+-  my_offsetof(TABLE_LIST, md5),
++  static_cast<int>(my_offsetof(TABLE_LIST, md5)),
+   FILE_OPTIONS_STRING},
+  {{ C_STRING_WITH_LEN("updatable")},
+-  my_offsetof(TABLE_LIST, updatable_view),
++  static_cast<int>(my_offsetof(TABLE_LIST, updatable_view)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("algorithm")},
+-  my_offsetof(TABLE_LIST, algorithm),
++  static_cast<int>(my_offsetof(TABLE_LIST, algorithm)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("definer_user")},
+-  my_offsetof(TABLE_LIST, definer.user),
++  static_cast<int>(my_offsetof(TABLE_LIST, definer.user)),
+   FILE_OPTIONS_STRING},
+  {{ C_STRING_WITH_LEN("definer_host")},
+-  my_offsetof(TABLE_LIST, definer.host),
++  static_cast<int>(my_offsetof(TABLE_LIST, definer.host)),
+   FILE_OPTIONS_STRING},
+  {{ C_STRING_WITH_LEN("suid")},
+-  my_offsetof(TABLE_LIST, view_suid),
++  static_cast<int>(my_offsetof(TABLE_LIST, view_suid)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("with_check_option")},
+-  my_offsetof(TABLE_LIST, with_check),
++  static_cast<int>(my_offsetof(TABLE_LIST, with_check)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("timestamp")},
+-  my_offsetof(TABLE_LIST, timestamp),
++  static_cast<int>(my_offsetof(TABLE_LIST, timestamp)),
+   FILE_OPTIONS_TIMESTAMP},
+  {{ C_STRING_WITH_LEN("create-version")},
+-  my_offsetof(TABLE_LIST, file_version),
++  static_cast<int>(my_offsetof(TABLE_LIST, file_version)),
+   FILE_OPTIONS_ULONGLONG},
+  {{ C_STRING_WITH_LEN("source")},
+-  my_offsetof(TABLE_LIST, source),
++  static_cast<int>(my_offsetof(TABLE_LIST, source)),
+   FILE_OPTIONS_ESTRING},
+  {{(char*) STRING_WITH_LEN("client_cs_name")},
+-  my_offsetof(TABLE_LIST, view_client_cs_name),
++  static_cast<int>(my_offsetof(TABLE_LIST, view_client_cs_name)),
+   FILE_OPTIONS_STRING},
+  {{(char*) STRING_WITH_LEN("connection_cl_name")},
+-  my_offsetof(TABLE_LIST, view_connection_cl_name),
++  static_cast<int>(my_offsetof(TABLE_LIST, view_connection_cl_name)),
+   FILE_OPTIONS_STRING},
+  {{(char*) STRING_WITH_LEN("view_body_utf8")},
+-  my_offsetof(TABLE_LIST, view_body_utf8),
++  static_cast<int>(my_offsetof(TABLE_LIST, view_body_utf8)),
+   FILE_OPTIONS_ESTRING},
+  {{NullS, 0},			0,
+   FILE_OPTIONS_STRING}
+
--- mysql-server-5.5.27.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120911155044.70203.qmail>