[lammps-users] restart2data compilation

Dear all, I have noticed questions on restart2data and thought to use it too. I have tried compiling it, however, I get this:

g++ -o restart2data.x restart2data.cpprestart2data.cpp: In function �void header(FILE*, Data&)�:
restart2data.cpp:417: warning: deprecated conversion from string constant to �char*�
restart2data.cpp:429: warning: deprecated conversion from string constant to �char*�

when i ask

g++ -o restart2data.x restart2data.cpp

Could somebody please let me know where I go wrong? Thank you very much!

Yours sincerely,

Anna

Dear all, I have noticed questions on restart2data and thought to use it
too. I have tried compiling it, however, I get this:

g++ -o restart2data.x restart2data.cpprestart2data.cpp: In function
‘void header(FILE*, Data&)’:
restart2data.cpp:417: warning: deprecated conversion from string
constant to ‘char*’
restart2data.cpp:429: warning: deprecated conversion from string
constant to ‘char*’

when i ask

g++ -o restart2data.x restart2data.cpp

Could somebody please let me know where I go wrong? Thank you very much!

there is nothing wrong. those are just warnings.
restart2data, like a lot of lammps, is written in a
somewhat conservative, i.e. more c-like than c++-like
style and this is deprecated in newer c++ standards,
and the GNU compiler folks enjoy educating people
about what is the "standard" way to do things.

if you want to "get scared", try compiling with:

g++ -Wall -W -O -o restart2data.x restart2data.cpp

if you want to "live in ignorant bliss" use:

g++ -w -o restart2data.x restart2data.cpp

cheers,
    axel.