File netcdf-h5-test-fix-type-mismatch.patch of Package netcdf

Subject: [netcdf] Fix type mismatch in tst_h_dimscales test

When iterating through scales, the test passed a pointer to a local
int variable for the iterator callback to use. The callback casts the
data to the hid_t type, which is incompatible with the int type. This
causes stack corruption and inevitably failure.

Changing the visitor_data to the hid_t type eliminates the stack
overflow and the test succeeds.

This was discovered while compiling with the mvapich2 compiler, built
using the SUSE-HPC build system.

Signed-off by: John Jolly <jjolly@suse.com>
---
Index: netcdf-4.4.1.1/h5_test/tst_h_dimscales.c
===================================================================
--- netcdf-4.4.1.1.orig/h5_test/tst_h_dimscales.c
+++ netcdf-4.4.1.1/h5_test/tst_h_dimscales.c
@@ -85,7 +85,7 @@ rec_scan_group(hid_t grpid)
 	    }
 	    else
 	    {
-	       int visitor_data = 0;
+	       hid_t visitor_data = 0;
 		  
 	       /* Here's how to get the number of scales attached
 		* to the dataset's dimension 0. */
@@ -426,7 +426,7 @@ main()
 	       else
 	       {
 		  char label[STR_LEN+1];
-		  int visitor_data = 0;
+		  hid_t visitor_data = 0;
 
 		  /* Here's how to get the number of scales attached
 		   * to the dataset's dimension 0. */
@@ -617,7 +617,7 @@ main()
 	       else
 	       {
 		  char label[STR_LEN+1];
-		  int visitor_data = 0;
+		  hid_t visitor_data = 0;
 		  
 		  /* SHould have these dimensions... */
 		  if (dims[TIME_DIM] != 0 || dims[LAT_DIM] != LAT_LEN || 
openSUSE Build Service is sponsored by