[petsc-dev] Uninitialized value 'basedimension2' in HDF5 Viewer

Håkon Strandenes haakon at hakostra.net
Fri Apr 17 04:00:32 CDT 2015


I don't think Bitbucket sends emails or does anything about comments to 
commits, so I thought I could bring up a small issue here:

See my comment: 
both to the commit itself and to file hdf5v.c:211.

Short summary:
I can't find any explicit default value for the basedimension2 flag 
recently added to the HDF5 viewer (correct me if I'm wrong). I have not 
read C or C++ standards closely, but unless the C/C++ standards specify 
that all enums always should be initialized to their first value, it 
seems to me that we rely on the compiler to choose a default value. 
Could we also risk that the basedimension2 flag gets a value that is 
neither PETSC_TRUE nor PETSC_FALSE, since the enum maps to an int (at 
least in plain C), and the int can take values different from 0 

I also see that the binary viewer explicitly sets a default value for 
all its PetscBool flags...


I think this flag is great, and toggle it when switching between writing 
plain Vecs (in which I do not want this extra dim for bs=1) and DMDA's 
(where I find it practical to have an extra dim for dof=1).

More information about the petsc-dev mailing list