[petsc-dev] Could you look at this warning?

Jed Brown jed at jedbrown.org
Tue Mar 1 19:15:08 CST 2016


Barry Smith <bsmith at mcs.anl.gov> 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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20160302/1d3ac21b/attachment.sig>


More information about the petsc-dev mailing list