HP aC++ Release Notes Version A.03.95 (5900-1789; September 2011)

HP aC++ Release Notes
New Features in Version A.03.25
Chapter 164
fprintf(stderr, “Flag” );
fprintf(stderr, “X = %d\n”, x );
puts( “The first, second, and third items.” );
((x>y)?puts(“x>y”):printf(“x is %d but y is %d”, x, y))
For GNU/gcc style coding:
Similar to the variable arguments function described above, a macro can accept a variable number of
arguments. Following is an example:
#define Myprintf(format, args...) \
fprintf (stderr, format, ## args)
Myprintf (“%s:%d: “, input_file_name, line_number)
Will be expanded to:
fprintf (stderr, “%s:%d: “ , input_file_name, line_number)
Note the use of ## to handle the case when args matches no arguments. In this case, args is empty, and if
there is no ##, the macro expansion could be like the following invalid syntax:
fprintf (stderr, “success!\n” , )
By using ##, the comma is concatenated with empty valued arguments, and is discarded at macro expansion.
In the case mentioned above, gcc currently discards only the last preceding sequence of non-whitespace
characters, while HP aC++ discards the last preprocessor token.
Alignment of long double Data Type in 64-bit mode Changed to 16-bytes
Alignment of the long double data type in 64-bit mode (+DA2.0W) is now 16-bytes. This ensures
compatibility with the HP PA-RISC ABI and HP C.
In particular, the layout and alignment of a struct that contains jmp_buf are now identical for HP C and HP
aC++ (since jmp_buf is a typedef that is defined with a long double).
For code compiled with the prior 8-byte default, a problem occurs when a long double is a field in a class,
struct or union. When the structure in question is shared between C and C++ there is a 50% chance that the
fields are not on the same offsets in both languages, and the wrong data will be accessed.
Symptoms of this problem might be:
Wrong runtime results and corruption
Various aborts if there are pointers that occur after the long double fields
NOTE If you must use the prior 8-byte alignment for long double, use