VirtualBox

Changeset 9396

Show
Ignore:
Timestamp:
06/04/08 19:47:52 (3 months ago)
Author:
vboxsync
Message:

type promotion warning for 64-bit. (Hope it's correctly formulated.)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/doc/VBox-CodingGuidelines.cpp

    r8155 r9396  
    186186 *      - Take care and use size_t when you have to, esp. when passing a pointer 
    187187 *        to a size_t as a parameter. 
     188 * 
     189 *      - Be wary of type promotion to (signed) integer. For example the 
     190 *        following will cause u8 to be promoted to int in the shift, and then 
     191 *        sign extended in the assignment 64-bit: 
     192 *        @code 
     193 *              uint8_t u8 = 0xfe; 
     194 *              uint64_t u64 = u8 << 24; 
     195 *              // u64 == 0xfffffffffe000000 
     196 *        @endcode 
    188197 * 
    189198 * 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy