title: Disabling "cast from pointer to smaller type uint32_t" error in Clang
body: <p>I'm working on a school project that involves porting a large piece of C++ code on an experimental piece of hardware. Unfortunately, that hardware is 64-bit and the code contains many instances of pointer arithmetic that expects pointers to be 32-bit, i.e. it often does <code>reinterpret_cast&lt;uint32_t&gt;(ptr)</code>.</p>
  
  <p>Going through them one by one would be very tedious and since this is an experimental project anyway, I'm happy to settle for a "hackish" workaround. So instead I modified the implementation of malloc to ensure it never allocates memory above the 4GB limit. Technically, these casts should therefore be valid. </p>
  
  <p>Question is, how do I explain this to Clang? The error I'm getting is: <code>error: cast from pointer to smaller type 'uint32_t' (aka 'unsigned int') loses information</code>. Is there a way to disable it?</p>
  
  <p>Thanks,
  David</p>