[cmake-developers] [PATCH] Avoid bad alloc for large files

Brad King brad.king at kitware.com
Tue Dec 23 04:34:03 EST 2014


On 12/23/2014 4:27 AM, Rolf Eike Beer wrote:
> cmCTest.cxx
> C:\Dashboards\My Tests\CMakeNext-vs12-64-ninja-src\Source\cmCTest.cxx(1705) : 
> warning C4267: 'argument' : conversion from 'size_t' to 'unsigned long', 
> possible loss of data
> 
> The problem is: this is absolutely right. On Windows64 this means that the 
> maximum file size will be 4GB, or one needs to change the base64 
> implementation. Which way to go?

The KWSys Base64 API should be fixed to use size_t:

 http://review.source.kitware.com/18579

Domen's suggestion elsewhere in this thread of using a streaming
implementation will be necessary to support large files on 32-bit
platforms.  That can be done as follow-up work though.

-Brad


More information about the cmake-developers mailing list