HP Code Advisor

10 Incompatibilities on PA-RISC Based Systems
On PA-RISC-based systems, a few non-standard source constructs may not be accepted by
cadvise. In such cases, cadvise generates an error and continues processing the next source file.
For more information, see the following page:
aC++ standard conformance and compatibility changes.
In such cases, the best way is to modify the source code so that the code is more standards
compliant and is compilable on platforms based on both Integrity and PA-RISC.
Some of the C99 constructs like variable length arrays, compound literals, and designated
initializers are enabled by default in the HP C compiler on PA-RISC and do not require the -AC99
flag to be used. However, these constructs result in error when cadvise is used with the HP C
compiler. In such cases, the solution is to pass the -AC99 flag to cc. For example, see the following
source code:
/*vla.c*/
int dep;
int main(){
int arr[dep];
}
The declaration is logically incorrect as the array would have zero size. Initialize the variable
dep with some non-zero positive value as int dep = 128;
Using /opt/cadvise/bin/cadvise cc -c vla.c at the command line generates the
following warning without the -AC99 flag:
"vla.c", line 4: error #2028: expression must have a constant value int arr[dep];
Using /opt/cadvise/bin/cadvise cc -c -AC99 vla.c at the command line suppresses
this warning.
69