[xxdiff] Fix FTBFS with gcc 4.7

Paul Howarth pghmcfc at fedoraproject.org
Sun Apr 22 12:45:07 UTC 2012


commit 0c01e02ef2049c2f5be7d2a79d802738783927fb
Author: Paul Howarth <paul at city-fan.org>
Date:   Sun Apr 22 13:44:54 2012 +0100

    Fix FTBFS with gcc 4.7

 xxdiff-3.2-c-linkage.patch        |   10 ++
 xxdiff-3.2-string-constants.patch |  258 +++++++++++++++++++++++++++++++++++++
 xxdiff.spec                       |   13 ++-
 3 files changed, 280 insertions(+), 1 deletions(-)
---
diff --git a/xxdiff-3.2-c-linkage.patch b/xxdiff-3.2-c-linkage.patch
new file mode 100644
index 0000000..4839a42
--- /dev/null
+++ b/xxdiff-3.2-c-linkage.patch
@@ -0,0 +1,10 @@
+--- src/main.h
++++ src/main.h
+@@ -35,6 +35,6 @@
+  * PUBLIC DECLARATIONS
+  *============================================================================*/
+ 
+-extern char** environ;
++extern "C" char** environ;
+ 
+ #endif
diff --git a/xxdiff-3.2-string-constants.patch b/xxdiff-3.2-string-constants.patch
new file mode 100644
index 0000000..7e30504
--- /dev/null
+++ b/xxdiff-3.2-string-constants.patch
@@ -0,0 +1,258 @@
+--- xxdiff-3.2/src/pixmaps/xxdiff.xpm	2005-10-31 07:17:33.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/xxdiff.xpm	2009-06-17 11:11:54.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * xxdiff_xpm[] = {
++static const char * xxdiff_xpm[] = {
+ "190 75 2931 2",
+ "  	c None",
+ ". 	c #B8CFDD",
+--- xxdiff-3.2/src/pixmaps/next_difference.xpm	2005-10-31 07:17:33.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/next_difference.xpm	2009-06-17 11:19:26.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * next_difference_xpm[] = {
++static const char * next_difference_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/next_unselected_difference.xpm	2005-10-31 07:17:33.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/next_unselected_difference.xpm	2009-06-17 11:20:20.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * next_unselected_difference_xpm[] = {
++static const char * next_unselected_difference_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/previous_difference.xpm	2009-06-17 11:21:58.000000000 +0100
++++ xxdiff-3.2/src/pixmaps/previous_difference.xpm	2009-06-17 11:21:23.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * previous_difference_xpm[] = {
++static const char * previous_difference_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/previous_unselected_difference.xpm	2005-10-31 07:17:33.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/previous_unselected_difference.xpm	2009-06-17 11:22:49.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * previous_unselected_difference_xpm[] = {
++static const char * previous_unselected_difference_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/search.xpm	2005-10-31 07:17:33.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/search.xpm	2009-06-17 11:23:45.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * search_xpm[] = {
++static const char * search_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/search_backward.xpm	2005-10-31 07:17:37.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/search_backward.xpm	2009-06-17 11:25:06.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * search_backward_xpm[] = {
++static const char * search_backward_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/search_forward.xpm	2005-10-31 07:17:37.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/search_forward.xpm	2009-06-17 11:25:57.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * search_forward_xpm[] = {
++static const char * search_forward_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/select_region_left.xpm	2005-10-31 07:17:37.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/select_region_left.xpm	2009-06-17 11:26:53.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * select_region_left_xpm[] = {
++static const char * select_region_left_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/select_region_middle.xpm	2005-10-31 07:17:37.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/select_region_middle.xpm	2009-06-17 11:28:24.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * select_region_middle_xpm[] = {
++static const char * select_region_middle_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/select_region_neither.xpm	2005-10-31 07:17:37.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/select_region_neither.xpm	2009-06-17 11:29:34.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * select_region_neither_xpm[] = {
++static const char * select_region_neither_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/select_region_right.xpm	2005-10-31 07:17:37.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/select_region_right.xpm	2009-06-17 11:27:40.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * select_region_right_xpm[] = {
++static const char * select_region_right_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/select_region_unselect.xpm	2005-10-31 07:17:37.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/select_region_unselect.xpm	2009-06-17 11:30:32.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * select_region_unselect_xpm[] = {
++static const char * select_region_unselect_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/split_swap_join.xpm	2005-10-31 07:17:37.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/split_swap_join.xpm	2009-06-17 11:31:36.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * split_swap_join_xpm[] = {
++static const char * split_swap_join_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/diff_files.xpm	2005-10-31 07:18:48.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/diff_files.xpm	2009-06-17 11:32:31.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * diff_files_xpm[] = {
++static const char * diff_files_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/diff_files_next.xpm	2005-10-31 07:18:48.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/diff_files_next.xpm	2009-06-17 11:33:30.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * diff_files_next_xpm[] = {
++static const char * diff_files_next_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/save_as_left.xpm	2005-10-31 07:18:01.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/save_as_left.xpm	2009-06-17 11:34:17.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * save_as_left_xpm[] = {
++static const char * save_as_left_xpm[] = {
+ "32 32 52 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/save_as_middle.xpm	2005-10-31 07:18:01.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/save_as_middle.xpm	2009-06-17 11:35:06.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * save_as_middle_xpm[] = {
++static const char * save_as_middle_xpm[] = {
+ "32 32 52 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/save_as_right.xpm	2005-10-31 07:18:01.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/save_as_right.xpm	2009-06-17 11:35:48.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * save_as_right_xpm[] = {
++static const char * save_as_right_xpm[] = {
+ "32 32 52 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/save_as_merged.xpm	2005-10-31 07:18:01.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/save_as_merged.xpm	2009-06-17 11:37:14.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * save_as_merged_xpm[] = {
++static const char * save_as_merged_xpm[] = {
+ "32 32 52 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/save_as.xpm	2005-10-31 07:18:01.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/save_as.xpm	2009-06-17 11:38:08.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * save_as_xpm[] = {
++static const char * save_as_xpm[] = {
+ "32 32 52 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/return_accept.xpm	2005-10-31 07:18:48.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/return_accept.xpm	2009-06-17 11:39:08.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * return_accept_xpm[] = {
++static const char * return_accept_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/return_reject.xpm	2005-10-31 07:18:48.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/return_reject.xpm	2009-06-17 11:39:53.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * return_reject_xpm[] = {
++static const char * return_reject_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/pixmaps/return_merged.xpm	2005-10-31 07:18:48.000000000 +0000
++++ xxdiff-3.2/src/pixmaps/return_merged.xpm	2009-06-17 11:40:37.000000000 +0100
+@@ -1,5 +1,5 @@
+ /* XPM */
+-static char * return_merged_xpm[] = {
++static const char * return_merged_xpm[] = {
+ "32 32 2 1",
+ " 	c None",
+ ".	c #000000",
+--- xxdiff-3.2/src/resParser.cpp	2006-06-11 22:12:33.000000000 +0100
++++ xxdiff-3.2/src/resParser.cpp	2009-06-17 11:51:51.000000000 +0100
+@@ -1074,7 +1074,7 @@
+       XxCommandSwitch bo = XxCommandSwitch(commandSwitchList[ii]._token);
+       int b1 = res1.getInitSwitch( bo );
+       XX_CHECK( -1 <= b1 && b1 <= 1 );
+-      char* bmap[3] = { "Nop", "False", "True" };
++      const char* bmap[3] = { "Nop", "False", "True" };
+       if ( b1 != res2.getInitSwitch( bo ) ) {
+          os << initSwitchStr << "." << commandSwitchList[ii]._name << ": "
+             << bmap[b1+1] << endl;
+@@ -1250,7 +1250,7 @@
+       XxCommandSwitch bo = XxCommandSwitch(commandSwitchList[ii]._token);
+       int b1 = res.getInitSwitch( bo );
+       XX_CHECK( -1 <= b1 && b1 <= 1 );
+-      char* bmap[3] = { "Nop", "False", "True" };
++      const char* bmap[3] = { "Nop", "False", "True" };
+       os << initSwitchStr << "." << commandSwitchList[ii]._name << ": "
+          << bmap[b1+1] << endl;
+    }
+@@ -1558,7 +1558,7 @@
+          XxCommandSwitch bo = XxCommandSwitch(commandSwitchList[ii]._token);
+          int b1 = res.getInitSwitch( bo );
+          XX_CHECK( -1 <= b1 && b1 <= 1 );
+-         char* bmap[3] = { "Nop", "False", "True" };
++         const char* bmap[3] = { "Nop", "False", "True" };
+          os << tok->_name << "." << commandSwitchList[ii]._name << ": "
+             << bmap[b1+1] << "" << endl;
+       }
+--- xxdiff-3.2/src/util.cpp	2006-06-11 22:12:33.000000000 +0100
++++ xxdiff-3.2/src/util.cpp	2009-06-17 12:15:48.000000000 +0100
+@@ -789,8 +789,8 @@
+    }
+    if ( pid == 0 ) {
+       char* argv[4];
+-      argv[0] = "sh";
+-      argv[1] = "-c";
++      argv[0] = strdup("sh");
++      argv[1] = strdup("-c");
+       argv[2] = const_cast<char*>( command.latin1() );
+       argv[3] = 0;
+       execve( "/bin/sh", argv, environ );
diff --git a/xxdiff.spec b/xxdiff.spec
index a73b991..0aa57ea 100644
--- a/xxdiff.spec
+++ b/xxdiff.spec
@@ -1,7 +1,7 @@
 Summary:	Graphical file and directories comparator and merge tool
 Name:		xxdiff
 Version:	3.2
-Release:	16%{?dist}
+Release:	17%{?dist}
 License:	GPLv2+
 Group:		Development/Tools
 URL:		http://furius.ca/xxdiff/
@@ -12,6 +12,8 @@ BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:	qt3-devel < 1:4.0, bison, flex
 
 Patch0:		%{name}-fix-cstdlib_h.patch
+Patch1:		xxdiff-3.2-c-linkage.patch
+Patch2:		xxdiff-3.2-string-constants.patch
 
 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
@@ -33,6 +35,12 @@ Tools for xxdiff
 %setup -q
 %patch0 -p2
 
+# Fix FTBFS with gcc 4.7
+%patch1
+
+# Fix the multitude of warnings about string constants converted to 'char*'
+%patch2 -p1
+
 %build
 if [ -z "$QTDIR" ]; then 
   . /etc/profile.d/qt.sh
@@ -86,6 +94,9 @@ find ./build  -name \*.py  -print  -exec %{__sed} -i "1{/^#\!/d}" {} \;
 %{_bindir}/xx-svn-resolve
 
 %changelog
+* Sun Apr 22 2012 Paul Howarth <paul at city-fan.org> - 3.2-17
+- Fix FTBFS with gcc 4.7
+
 * Tue Feb 28 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.2-16
 - Rebuilt for c++ ABI breakage
 


More information about the scm-commits mailing list