Compiler warning coming from system include file.

Hi. When I compile an app I’m porting from QNX 4, I get this warning
three times:

In file included from /usr/include/xlocale:9,
from /usr/include/xiosbase:4,
from /usr/include/streambuf:4,
from /usr/include/xlocnum:8,
from /usr/include/ios:4,
from /usr/include/ostream:4,
from /usr/include/istream:4,
from /usr/include/fstream:4,
from /usr/include/fstream.h:4,
from …/FaacppLib/i_include/init-cfg.h:169,
from src/exec.cpp:21:
/usr/include/xlocinfo: In method `void * std::_Timevec::_Getptr() const’:
/usr/include/xlocinfo:53: warning: cast discards qualifiers from pointer
target type

I’m fairly certain nothing I’m doing is causing this (although I could
be wrong); is this a problem with the header file itself, or just an
incompatibility between the Dinkum headers and GCC?

Josh Hamacher
FAAC Incorporated

It’s actually a consequence of turning up the warning level. It adds
the -Wcast-qual

You can add -Wno-cast-qual to your compile line to get rid of these.

Josh Hamacher <hamacher@faac.com> wrote:

Hi. When I compile an app I’m porting from QNX 4, I get this warning
three times:

In file included from /usr/include/xlocale:9,
from /usr/include/xiosbase:4,
from /usr/include/streambuf:4,
from /usr/include/xlocnum:8,
from /usr/include/ios:4,
from /usr/include/ostream:4,
from /usr/include/istream:4,
from /usr/include/fstream:4,
from /usr/include/fstream.h:4,
from …/FaacppLib/i_include/init-cfg.h:169,
from src/exec.cpp:21:
/usr/include/xlocinfo: In method `void * std::_Timevec::_Getptr() const’:
/usr/include/xlocinfo:53: warning: cast discards qualifiers from pointer
target type

I’m fairly certain nothing I’m doing is causing this (although I could
be wrong); is this a problem with the header file itself, or just an
incompatibility between the Dinkum headers and GCC?

Josh Hamacher
FAAC Incorporated


cburgess@qnx.com