[svn-r24112] Description:

Bring r24101 & 24111 from trunk to 1.8 branch:

r24101:
=======
Description:
    Clean up warnings, enable new compiler warning flag(s) and bring back
changes from Coverity branch:

    r20813:
        Remove the dead code as listed for coverity bug #1722. h5committested.

    r20814:
        Issue 69: Check return value and throw error if negative return. Also free datatype id on error

    r20815:
        Use HDstrncpy. --gh

    r20816:
        Replaced one last HDstrcat call with HDstrncat to resolve coverity issue 832.

    r20817:
        Use HDstrncpy and HDstrncat. --gh

    r20818:
        Purpose: Fix valgrind issues with h5jam

        Description:
        Modified h5jam to free strings strdup'd in parse_command_line before exit. Note
        that they may still not be freed in case of error, due to the widespread use of
        exit().

    r20819:
        Issue 80: change loop to use int as loop index.

    r20820:
        Maintenance: Fixed the bug found by coverity CID 788
        There were two problems with this function:
            1) it tried to unnecessary free NULL pointer
        2) it tried to allocate c_name buffer that is done by H5Pget_class_name

r24111:
=======
Description:
   Restrict GCC diagnostic pragmas to only gcc 4.6+


Tested on:
    Mac OSX 10.8.4 (amazon) w/gcc 4.8.1, C++ & FORTRAN
    (too minor to require h5committest)
This commit is contained in:
Quincey Koziol
2013-09-06 14:09:07 -05:00
parent ad7d03103d
commit 38e0563a6e
18 changed files with 246 additions and 138 deletions

View File

@@ -109,7 +109,7 @@ static hbool_t not_comparable;
if(0 == (A) && 0 == (B)) \
both_zero = TRUE; \
if(0 != (A)) \
per = (double)ABS((double)(B - A) / (double)A); \
per = (double)ABS((double)((B) - (A)) / (double)(A)); \
else \
not_comparable = TRUE; \
}
@@ -119,16 +119,16 @@ static hbool_t not_comparable;
per = -1; \
not_comparable = FALSE; \
both_zero = FALSE; \
if(A == 0 && B == 0) \
if((A) == 0 && (B) == 0) \
both_zero = TRUE; \
if(A != 0) \
per = ABS((double)((TYPE)(B - A)) / (double)A) ; \
if((A) != 0) \
per = ABS((double)((TYPE)((B) - (A))) / (double)(A)) ; \
else \
not_comparable = TRUE; \
}
# define PDIFF(a,b) ( (b>a) ? (b-a) : (a-b))
#define PDIFF(a,b) (((b) > (a)) ? ((b) - (a)) : ((a) -(b)))
typedef struct mcomp_t
{
@@ -887,9 +887,8 @@ static hsize_t diff_datum(void *_mem1,
/* calculate the number of array elements */
for (u = 0, nelmts = 1; u < (unsigned)ndims; u++)
nelmts *= adims[u];
for (u = 0; u < nelmts; u++)
{
nfound+=diff_datum(
for (u = 0; u < nelmts; u++) {
nfound += diff_datum(
mem1 + u * size,
mem2 + u * size, /* offset */
memb_type,
@@ -904,7 +903,7 @@ static hsize_t diff_datum(void *_mem1,
container1_id,
container2_id,
ph, members);
}
}
H5Tclose(memb_type);
}
break;