> On Mar 1, 2016, at 7:15 PM, Jed Brown <[email protected]> wrote: > > Barry Smith <[email protected]> writes: > >> I've been ignoring this for a long time. We need to either >> >> 1) fscanf into a local int that is 32 bit and then copy it into data but >> that will produce an incorrect value for very long integers passed in or >> >> 2) have an ifdef that uses the correct %lld format when needed, maybe >> something like > > Why not always read into a long long? > > else if (dtype == PETSC_INT) if ((ret = fscanf(fd, "%lld", &tmp)) > 0) > ((PetscInt*)data)[i] = tmp;
It is not clear that Microsoft compilers support this :-( but it would be a reasonable way to go (with a caste check of course). Barry
