[petsc-dev] clang warning, 64bit indices

Lisandro Dalcin dalcinl at gmail.com
Wed Mar 9 13:23:52 CST 2016


I got the following warning using clang on Mac with 64bit indices. The
warning is legit, however fixing it as suggested might be problematic
on Window, I think we should use "%I64d" in that platform (see
http://stackoverflow.com/questions/18107426/printf-format-for-unsigned-int64-on-windows)

Satish, any change you could confirm?


/Users/dalcinl/Devel/petsc-dev/src/sys/classes/viewer/impls/ascii/filev.c:1054:63:
warning: format specifies type 'long *' but the argument has type
'PetscInt *' (aka 'long long *')
      [-Wformat]
    else if (dtype == PETSC_INT)     ret = fscanf(fd, "%ld",
&(((PetscInt*)data)[i]));
                                                       ~~~
^~~~~~~~~~~~~~~~~~~~~~~
                                                       %lld

-- 
Lisandro Dalcin
============
Research Scientist
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
Extreme Computing Research Center (ECRC)
King Abdullah University of Science and Technology (KAUST)
http://ecrc.kaust.edu.sa/

4700 King Abdullah University of Science and Technology
al-Khawarizmi Bldg (Bldg 1), Office # 4332
Thuwal 23955-6900, Kingdom of Saudi Arabia
http://www.kaust.edu.sa

Office Phone: +966 12 808-0459



More information about the petsc-dev mailing list