diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-01-29 17:38:15 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-01-29 17:38:15 -0500 |
commit | 73d605b0f759a2ff9f859f78f76098dcdb290d37 (patch) | |
tree | 6293cd558c73359e726a40c8d6157af08be7cd35 /src/common | |
parent | a0351311aeea715cea24e156e065b65cc29a804c (diff) | |
download | tor-73d605b0f759a2ff9f859f78f76098dcdb290d37.tar.gz tor-73d605b0f759a2ff9f859f78f76098dcdb290d37.zip |
Detect platforms where memset(0) doesn't set doubles to 0.0.
This is allowed by the C statndard, which permits you to represent
doubles any way you like, but in practice we have some code that
assumes that memset() clears doubles in structs. Noticed as part of
7802 review; see 8081 for more info.
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/compat.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/compat.h b/src/common/compat.h index 25293a4ed6..b036419718 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -74,6 +74,11 @@ #error "It seems your platform does not represent NULL as zero. We can't cope." #endif +#ifndef DOUBLE_0_REP_IS_ZERO_BYTES +#error "It seems your platform does not represent 0.0 as zeros. We can't cope." +#endif + + #if 'a'!=97 || 'z'!=122 || 'A'!=65 || ' '!=32 #error "It seems that you encode characters in something other than ASCII." #endif |