HP aC++/HP C A.06.20 Programmer's Guide

Using the extern "C" Linkage Specification...........................................................246
Syntax of extern "C"................................................................................................246
Examples of extern "C"...........................................................................................247
Differences in Argument Passing Conventions.....................................................247
The main() Function...............................................................................................247
Examples: HP aC++ Calling HP C..........................................................................248
Running the Example.......................................................................................249
HP C Calling HP aC++.................................................................................................249
Compiling and Running the Sample Programs.....................................................251
Calling HP FORTRAN 90 from HP aC++....................................................................251
The main() Function...............................................................................................252
Function Naming Conventions..............................................................................252
Using Reference Variables to Pass Arguments......................................................252
Example of Reference Variables as Arguments................................................252
Using extern "C" Linkage.......................................................................................253
Strings.....................................................................................................................253
Arrays.....................................................................................................................253
Files in FORTRAN..................................................................................................253
11 Distributing Your C++ Products...............................................................................................255
Applications that use HP aC++ Shared Libraries.............................................................255
Linking Your HP aC++ Libraries with Other Languages.................................................256
Installing your Application...............................................................................................256
HP aC++ Files You May Distribute...................................................................................257
Terms for Distribution of HP aC++ Files...........................................................................257
12 Migrating from HP C++ (cfront) to HP aC++............................................................................259
General Guidelines for Migration.....................................................................................259
Getting Started with Migration...................................................................................259
Writing Code for both Compilers................................................................................260
Explicit Loading and Unloading of Shared Libraries ................................................260
Memory Allocation......................................................................................................260
Command-Line Differences..............................................................................................260
New Command-Line Options.....................................................................................261
Obsolete Command-Line Options...............................................................................261
Changed Command-Line Options..............................................................................263
Migration Considerations when Debugging....................................................................264
Migration Considerations when Using Exception Handling...........................................264
Exception Handling is the Default..............................................................................265
Memory Allocation Failure and operator new............................................................265
Possible Differences when Exiting a Signal Handler..................................................266
Differences in setjmp/longjmp Behavior.....................................................................266
Calling unexpected......................................................................................................267
18 Table of Contents