ports/184566: biology/plink : fix build with gcc47

Christoph Moench-Tegeder cmt at burggraben.net
Sat Dec 7 16:50:01 UTC 2013


>Number:         184566
>Category:       ports
>Synopsis:       biology/plink : fix build with gcc47
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 07 16:50:01 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Christoph Moench-Tegeder
>Release:        FreeBSD 9.2-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD elch.exwg.net 9.2-RELEASE FreeBSD 9.2-RELEASE #11 r255911: Fri Sep 27 17:09:40 CEST 2013 cmt at elch.exwg.net:/usr/obj/usr/src/sys/ELCH amd64

lang/gcc47		gcc47-4.7.4.20131130
biology/plink	plink-1.07_1

>Description:
Hi,

in an effort towards upgrading lang/gcc to gcc 4.7, I'm helping gerald@
in making ports gcc47-safe.
Please consider the following patch to your port. If you approve of the
patch, gerald@ has offered his help in commiting it.
If you're commiting yourself or have someone else commit this (or
another patch to the same effect), can you please add an additional
reference to ports/183342 in the commit message?
In my test environment, the port built successfully with lang/gcc47.

>How-To-Repeat:

>Fix:

This patch fixes some cases of illegal C++ (rejected by gcc47)

# fix illegal variable name reuse
$ svn status
A       files/patch-elf.cpp
A       files/patch-idhelp.cpp
A       files/patch-sets.cpp

Index: files/patch-elf.cpp
===================================================================
--- files/patch-elf.cpp	(revision 0)
+++ files/patch-elf.cpp	(working copy)
@@ -0,0 +1,25 @@
+--- elf.cpp.orig	2013-11-16 17:09:56.000000000 +0100
++++ elf.cpp	2013-11-16 17:10:24.000000000 +0100
+@@ -1175,10 +1175,10 @@
+ 	  << setw(8) << gcnt << " "
+ 	  << setw(8) << (double)cnt / (double)gcnt << "\n";
+ 
+-      map<int,int>::iterator i = chr_cnt.begin();
+-      while ( i != chr_cnt.end() )
++      map<int,int>::iterator ichr = chr_cnt.begin();
++      while ( ichr != chr_cnt.end() )
+ 	{
+-	  int c = i->first;
++	  int c = ichr->first;
+ 	  int x = chr_cnt.find( c )->second;
+ 	  int y = chr_gcnt.find( c )->second;
+ 	  
+@@ -1189,7 +1189,7 @@
+ 	      << setw(8) << y << " "
+ 	      << setw(8) << (double)x / (double)y << "\n";
+ 	  
+-	  ++i;
++	  ++ichr;
+ 	}
+       
+     }
Index: files/patch-idhelp.cpp
===================================================================
--- files/patch-idhelp.cpp	(revision 0)
+++ files/patch-idhelp.cpp	(working copy)
@@ -0,0 +1,19 @@
+--- idhelp.cpp.orig	2013-11-16 17:11:42.000000000 +0100
++++ idhelp.cpp	2013-11-16 17:12:53.000000000 +0100
+@@ -772,12 +772,12 @@
+       for (int j = 0 ; j < jointField.size(); j++ )
+ 	{
+ 	  set<IDField*> & jf = jointField[j];
+-	  set<IDField*>::iterator j = jf.begin();
++	  set<IDField*>::iterator jfit = jf.begin();
+ 	  PP->printLOG(" { ");
+-	  while ( j != jf.end() )
++	  while ( jfit != jf.end() )
+ 	    {
+-	      PP->printLOG( (*j)->name + " " );
+-	      ++j;
++	      PP->printLOG( (*jfit)->name + " " );
++	      ++jfit;
+ 	    }
+ 	  PP->printLOG(" }");
+ 	}
Index: files/patch-sets.cpp
===================================================================
--- files/patch-sets.cpp	(revision 0)
+++ files/patch-sets.cpp	(working copy)
@@ -0,0 +1,18 @@
+--- sets.cpp.orig	2013-11-16 17:06:29.000000000 +0100
++++ sets.cpp	2013-11-16 17:07:12.000000000 +0100
+@@ -768,11 +768,11 @@
+       //////////////////////////////////////////////
+       // Reset original missing status
+ 
+-      vector<Individual*>::iterator i = PP->sample.begin();
+-      while ( i != PP->sample.end() )
++      vector<Individual*>::iterator ipp = PP->sample.begin();
++      while ( ipp != PP->sample.end() )
+ 	{
+-	  (*i)->missing = (*i)->flag;
+-	  ++i;
++	  (*ipp)->missing = (*ipp)->flag;
++	  ++ipp;
+ 	}
+ 
+       ////////////////////////////////////////////////


Regards,
Christoph
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-ports-bugs mailing list