» Sign in
  
Jump to HP Home Jump to Product & Services Jump to Support & Drivers Jump to Solutions Jump to How to buy
» Contact HP
 » Advanced Search
Jump to HP Home

Portability checklist for software development on Integrity servers

Developer & Solution Partner Program (DSPP)


A site for HP Partners

 »  DSPP home

Benefits & Services
 »  Marketing & Sales
 »  Technical
 »  Collaboration

Resources & Downloads
 »  Technologies & Tools
 »  HP Products
 »  HP Solutions
 »  Software downloads

 »  Specialized programs

 »  Events
 »  Newsletters

Partner information
 »  Find a partner
 »  Find a partner solution

Shortcuts for
 »  Independent software vendors
 »  Integrators & Consultants

About DSPP
 »  Why join?
 »  Membership benefits

 »  Latest updates

 »  Contact us

 »  Site map

The following suggestions increase your code's portability. For more detailed information, see writing portable code or transitioning C and aC++ Programs to the 64-bit Data Model.
Data
[   ]use the new integral types, such as int64_t, defined in <inttypes.h>
[   ]inspect variables defined as int and long (sizes vary by platform)
[   ]never cast pointers to integral data types that don't scale, such as ints or longs
[   ]check that casts don't truncate data, including numeric constants
[   ]don't do pointer arithmetic
[   ]use sizeof and offsetof to access data structures rather than constant numeric offsets
[   ]don't use hardcoded values for sizes of data types, bit shifts, or memory allocation
[   ]avoid mixing data types in assignments and comparisons (implicit casting)
[   ]avoid using fixed-size bit masks
Functions
[   ]use explicit function prototypes rather than letting parameters default to int or long
[   ]use the constants defined in <inttypes.h> to select printf formatting options
[   ]don't use in-line assembly (locate assembly code in a separate file and recode it for Itanium-based architecture)
[   ]Be careful while using pointers or longs as function parameters or return values as sizes vary by platform. Explicitly including function prototypes for all the functions is recommended to alleviate the problem.
General
[   ]always use ANSI compilers
[   ]use standard API calls to get system parameters
[   ]use code guards (include #error to prevent drop-throughs) when code is platform-specific
[   ]remove dead code
[   ]inspect your hash implementation, especially if using pointers as keys (many algorithms expect 32-bit data)
[   ]don't use self-modifying code
[   ]avoid data-packing code
[   ]use caution when storing or restoring on-disk structures








Printable version

Privacy statement Using this site means you accept its terms Trademark acknowledgment Contact us
HP Confidential © 2009 Hewlett-Packard Development Company, L.P.