http://coolshell.cn/articles/3512.html
在http://www.viva64.com/en/l/上例出了28个在64位平台上使用C/C++开发的注意事项,对于进入64位时代的程序员应该去看看这28个事项,这些英文读物对于有C/C++功底的朋友读起来应该并不难,我估计大约20-30分钟可以精读完一篇(或者更快),下面是这28个注意事项的列表。相信对大家一点有帮助。
- Lesson 01. What 64-bit systems are.
- Lesson 02. Support of 32-bit applications.
- Lesson 03. Porting code to 64-bit systems. The pros and cons.
- Lesson 04. Creating the 64-bit configuration.
- Lesson 05. Building a 64-bit application.
- Lesson 06. Errors in 64-bit code.
- Lesson 07. The issues of detecting 64-bit errors.
- Lesson 08. Static analysis for detecting 64-bit errors.
- Lesson 09. Pattern 01. Magic numbers.
- Lesson 10. Pattern 02. Functions with variable number of arguments.
- Lesson 11. Pattern 03. Shift operations.
- Lesson 12. Pattern 04. Virtual functions.
- Lesson 13. Pattern 05. Address arithmetic.
- Lesson 14. Pattern 06. Changing an array’s type.
- Lesson 15. Pattern 07. Pointer packing.
- Lesson 16. Pattern 08. Memsize-types in unions.
- Lesson 17. Pattern 09. Mixed arithmetic.
- Lesson 18. Pattern 10. Storage of integer values in double.
- Lesson 19. Pattern 11. Serialization and data interchange.
- Lesson 20. Pattern 12. Exceptions.
- Lesson 21. Pattern 13. Data alignment.
- Lesson 22. Pattern 14. Overloaded functions.
- Lesson 23. Pattern 15. Growth of structures’ sizes.
- Lesson 24. Phantom errors.
- Lesson 25. Working with patterns of 64-bit errors in practice.
- Lesson 26. Optimization of 64-bit programs.
- Lesson 27. Peculiarities of creating installers for a 64-bit environment.
- Lesson 28. Estimating the cost of 64-bit migration of C/C++ applications.
64位编程错误示例集锦
http://www.viva64.com/en/a/0065/
- Example 1. Buffer overflow
- Example 2. Unnecessary type conversions
- Example 3. Incorrect #ifdef's
- Example 4. Confusion of int and int*
- Example 5. Using deprecated (obsolete) functions
- Example 6. Truncation of values at an implicit type conversion
- Example 7. Undefined functions in C
- Example 8. Remains of dinosaurs in large and old programs
- Example 9. Virtual functions
- Example 10. Magic constants as parameters
- Example 11. Magic constants denoting size
- Example 12. Stack overflow
- Example 13. A function with a variable number of arguments and buffer overflow
- Example 14. A function with a variable number of arguments and wrong format
- Example 15. Storing integer values in double
- Example 16. Address arithmetic. A + B != A - (-B)
- Example 17. Address arithmetic. Signed and unsigned types.
- Example 18. Address arithmetic. Overflows.
- Example 19. Changing an array's type
- Example 20. Wrapping a pointer in a 32-bit type
- Example 21. Memsize-types in unions
- Example 22. An infinity loop
- Example 23. Bit operations and NOT operation
- Example 24. Bit operations, offsets
- Example 25. Bit operations and sign extension
- Example 26. Serialization and data exchange
- Example 27. Changes in type alignment
- Example 28. Type alignments and why you mustn't write sizeof(x) + sizeof(y)
- Example 29. Overloaded functions
- Example 30. Errors in 32-bit units working in WoW64
- Summary
- References