Skip to content

Commit

Permalink
Use a pragma to disable GCC's warnings due to the unsafe conversion i…
Browse files Browse the repository at this point in the history
…n VALGRIND_MAKE_MEM_UNDEFINED()
  • Loading branch information
jedbrown committed May 24, 2011
1 parent 7ce9313 commit 6b5af6c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions include/dohp.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@
#include <stdint.h>
#include <petscsys.h>

#if defined dUSE_VALGRIND && 0
#define dPragmaQuote(a) _Pragma(#a)
#define dPragmaGCC(a) dPragmaQuote(GCC a)

#if defined dUSE_VALGRIND
# include <valgrind/memcheck.h>
# define dMakeMemUndefined(mem,bytes) do { \
if (VALGRIND_MAKE_MEM_UNDEFINED((mem),(bytes))) dERROR(PETSC_COMM_SELF,PETSC_ERR_LIB,"Valgrind returned an error"); \
memset(mem,0xff,bytes); \
dPragmaGCC(diagnostic ignored "-Wconversion") \
VALGRIND_MAKE_MEM_UNDEFINED((mem),(bytes)); \
} while (0)
#else
# define dMakeMemUndefined(mem,bytes) do { \
Expand Down

0 comments on commit 6b5af6c

Please sign in to comment.