BhallaLab / moose

MOOSE simulator.
http://moose.ncbs.res.in
GNU General Public License v3.0
25 stars 19 forks source link

Compilation problem with strict static type checkin with gcc4.8 and clang3.3 #130

Closed subhacom closed 8 years ago

subhacom commented 10 years ago

The compilation of pymoose/moosemodule.cpp will fail with following error with recent gcc and clang compilers.

g++ says.

/home/dilawar/Work/NCBS/moose_async_git/pymoose/moosemodule.cpp:1024:46: error: invalid conversion from ‘const Cinfo*’ to ‘Cinfo*’ [-fpermissive]
         Cinfo * cinfo = Cinfo::find(className);
```~~

clang++ says.

: error: cannot initialize a variable of type 'Cinfo ' with an rvalue of type 'const Cinfo ' Cinfo * cinfo = Cinfo::find(className); ^ ```````````````~~


Removing `const` from type signature of function `Cinfo::find` in `/basecode/Cinfo.h` and its definition in `basecode/Cinfo.cpp` fixes the problem. It tried adding `const` at the instantiation but then it propagates non-const error to other function as well.

Committed to `async_multiscale_cmake` branch. Won't change it in `async13` branch without a  confirmation.

Reported by: dilawar
dilawar commented 8 years ago

This was fixed by making few more definition 'const'.