Examples of errors detected by the V1032 diagnostic
V1032. Pointer is cast to a more strictly aligned pointer type.
qdEngine
V1032 [CWE-843, CERT-EXP36-C] The pointer 'buf' is cast to a more strictly aligned pointer type. zip_container.cpp 237
bool zipContainer::find_index() { const int buf_sz = 1024; char buf[buf_sz]; stream_.seek(0,XS_END); while(stream_.tell() >= buf_sz){ stream_.seek(-buf_sz,XS_CUR); stream_.read(buf,buf_sz); const unsigned long idx_signature = 0x06054b50L; for(int i = 0; i < buf_sz - sizeof(long) * 3; i++){ if(*((unsigned long*)(buf + i)) == idx_signature){ XBuffer xbuf(buf + i + sizeof(long) + sizeof(unsigned short) * 4, sizeof(long) * 2); xbuf > index_size_ > index_offset_; return true; } } } return false; } FreeCAD
V1032 [CWE-843, CERT-EXP36-C] The pointer 'auiResult' is cast to a more strictly aligned pointer type. Wm4TRational.inl 742
template <int N> void TRational<N>::ConvertTo (double& rdValue) const { assert(m_kDenom != 0); if (m_kNumer == 0) { rdValue = 0.0; return; } unsigned int auiResult[2]; .... rdValue = *(double*)auiResult; .... }