summaryrefslogtreecommitdiff
path: root/lib/backupstore
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2011-06-22 17:48:18 +0000
committerChris Wilson <chris+github@qwirx.com>2011-06-22 17:48:18 +0000
commit3523b38fcb2659da7d3fb7602b696a0d1fed592e (patch)
tree92406ffd0b2c60e982c8c7da448e6ba553bc2003 /lib/backupstore
parent569122697d5851f3f9fa127ecb58457fc3b18660 (diff)
Fix type aliasing that's strictly speaking incompatible and may actually be skipped by the compiler
(according to http://blog.worldofcoding.com/2010/02/solving-gcc-44-strict-aliasing-problems.html).
Diffstat (limited to 'lib/backupstore')
-rw-r--r--lib/backupstore/BackupClientFileAttributes.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/backupstore/BackupClientFileAttributes.cpp b/lib/backupstore/BackupClientFileAttributes.cpp
index 0d7df4d7..bc39bd8b 100644
--- a/lib/backupstore/BackupClientFileAttributes.cpp
+++ b/lib/backupstore/BackupClientFileAttributes.cpp
@@ -1183,6 +1183,7 @@ uint64_t BackupClientFileAttributes::GenerateAttributeHash(EMU_STRUCT_STAT &st,
digest.Finish();
// Return the first 64 bits of the hash
- uint64_t result = *((uint64_t *)(digest.DigestAsData()));
+ uint64_t result;
+ memcpy(&result, digest.DigestAsData(), sizeof(result));
return result;
}