<div dir="ltr">The cast macros like PetscBLASIntCast() are not "safe" in that they include two separate statements. Unfortunately, we cannot do better with C89 unless we pass the target as an argument. Regardless, these casts <b>cannot</b> be used in declarations.<div>
<br></div><div><font face="courier new, monospace">PetscBLASInt   one = 1,bn = PetscBLASIntCast(xin->map->n);<br></font></div><div style><font face="courier new, monospace">PetscErrorCode ierr;</font></div><div style>
<font face="courier new, monospace"><br></font></div><div style><font face="arial, helvetica, sans-serif">This is invalid C89 because once the macro expands, there is a statement before the next declaration. Furthermore, the check calls SETERRQ in case of failure, so it <b>must</b> be inside a PetscFunctionBegin/PetscFunctionReturn block.</font></div>
<div style><font face="arial, helvetica, sans-serif"><br></font></div><div style><font face="arial, helvetica, sans-serif">Should we change this cast to an inline function (or equivalent macro) so that this usage is more explicit?</font></div>
<div style><font face="arial, helvetica, sans-serif"><br></font></div><div style><font face="arial, helvetica, sans-serif">Regardless, Satish, can you set up a build --with-64-bit-indices CFLAGS='-std=c89 -pedantic -Wno-long-long'?</font></div>
</div>