[Bf-blender-cvs] [6a35b2d] master: Compiler Warnings: disallow 'long' in DNA, its not reliably 64bit (gcc only)

Campbell Barton noreply at git.blender.org
Wed Dec 4 03:53:08 CET 2013


Commit: 6a35b2d72ad37ff51f59485b138b37a28c47eaa9
Author: Campbell Barton
Date:   Wed Dec 4 13:51:41 2013 +1100
http://developer.blender.org/rB6a35b2d72ad37ff51f59485b138b37a28c47eaa9

Compiler Warnings: disallow 'long' in DNA, its not reliably 64bit (gcc only)

===================================================================

M	source/blender/makesdna/intern/makesdna.c

===================================================================

diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 2665da1..aac7924 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -1209,6 +1209,14 @@ int main(int argc, char **argv)
 
 #endif /* if 0 */
 
+/* even though DNA supports, 'long' shouldn't be used since it can be either 32 or 64bit,
+ * use int or int64_t instead.
+ * Only valid use would be as a runtime variable if an API expected a long,
+ * but so far we dont have this happening. */
+#ifdef __GNUC__
+#  pragma GCC poison long
+#endif
+
 #include "DNA_listBase.h"
 #include "DNA_vec_types.h"
 #include "DNA_ID.h"




More information about the Bf-blender-cvs mailing list