HP C Programmer's Guide (92434-90009)

Chapter 6 161
Migrating C Programs to HP-UX
Data Alignment
data files should migrate to the HP 9000 Series 700/800 without change.
Data Alignment
The HP 9000 Series 700/800 is stricter than other machines with respect to data
alignment. Misaligned data addresses cause bus errors when attempting to dereference
them. Use the +w1 option when compiling to report occurrences of "Casting from loose to
strict alignment." Fix occurrences that result from using the address of a more loosely
aligned item (such as char) to access a more strictly aligned item (such as int).
Unsupported Keywords
Some implementations of C permit use of the keywords asm, fortran, and entry. These
are not supported on the HP 9000 Series 700/800 computers. You must rewrite any code
that uses these keywords.
Predefined Macro Names
In non-ANSI mode, there are several HP C specific macro names defined. These names
may conflict with identifiers used in the source code.
The HP 9000 700/800 preprocessors predefine the macro names PWB, hpux, and unix. The
HP 9000 Series 700/800 predefines the macro name hp9000s800; the HP 9000 Series 500
predefines hp9000s500; and the HP 9000 Series 300/400 predefine the macro name
hp9000s300. The VAX predefines the macro name vax. If any of these macro names is
used as an identifier in the source code, use the #undef preprocessor directive to
"undefine" the macro or rename the identifier(s).
In ANSI mode, none of the above macro names are defined and you should not have
difficulty with these HP C specific macro names.
White Space
HP 9000 Series 300/400, 500, and 700/800 preprocessors do not include trailing white
space in the replacement text of a macro. The VAX preprocessor includes the trailing white
space. If your program depends on the inclusion of the white space, you can place white