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

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


Hi,

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: 
https://bitbucket.org/petsc/petsc/commits/056833d77d2d143230ea8833ad5b795a5f311c87?at=master 
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 
(PETSC_FALSE) and 1 (PETSC_TRUE)?

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

Regards,
Håkon


BTW:
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