Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#575 Get rid of loss-of-precision warnings on x64 MacOS

Platform_Specific
accepted
5
2012-12-13
2012-08-30
No

When building projects with strict error checking enabled on MacOS, Poco generates a lot of noise.

This fixes the prolific warning:

In file included from /usr/local/include/Poco/Util/ServerApplication.h:44:
In file included from /usr/local/include/Poco/Util/Application.h:45:
In file included from /usr/local/include/Poco/Util/LayeredConfiguration.h:44:
In file included from /usr/local/include/Poco/Util/AbstractConfiguration.h:46:
In file included from /usr/local/include/Poco/BasicEvent.h:43:
In file included from /usr/local/include/Poco/AbstractEvent.h:47:
In file included from /usr/local/include/Poco/ActiveMethod.h:46:
In file included from /usr/local/include/Poco/ActiveStarter.h:44:
In file included from /usr/local/include/Poco/ThreadPool.h:44:
In file included from /usr/local/include/Poco/Thread.h:56:
/usr/local/include/Poco/Thread_POSIX.h:212:17: warning: implicit conversion loses integer precision: 'const std::size_t' (aka 'const unsigned long') to 'int' [-Wshorten-64-to-32]
return _pData->stackSize;
1 warning generated.

although one wonders why ThreadData::stackSize is an 'std::size_t' and not an int... more broadly, there are a lot of places were 'int' is used for sizes (which will never be negative) instead of 'unsigned', as well.

But that's another can of worms.


Discussion

  • Squelch annoying 64-to-32 bit truncation warning

     
    Attachments
    • status: open --> pending
     
  • Alex Fabijanic
    Alex Fabijanic
    2012-12-13

    • status: pending --> accepted