HP aC++ A.03.85 Release Notes

HP aC++ Release Notes
New Features in Version A.03.25
Chapter 158
aCC -c foo.C
Error 440: “foo.C”, line 3 # Cannot initialize ‘char *’ with
‘const char *’. char* c=p;
^
Error 203: “foo.C”, line 8 # Cannot assign ‘char *’ with ‘
const char *’. c=p;
^
If you see a compile-time warning like the following:
Warning 829: Implicit conversion of string literal to ‘char*’ is deprecated.
These could be suppressed by a cast or const_cast like the above, then no further messages
will occur. Or they could be suppressed by using +W829. A compile-time error is generated
unless a cast is done, in which case there is no message, and a SIGBUS signal 10 could be
generated at runtime.
Note that if you used a cast at compile-time to suppress the error/warning you will have no
idea where to change the code to fix the runtime abort. If you want to find the source of your
problem, look for const_cast or warning 829, or any indication that you put the cast in the
source.
When using the debugger, you can print out what you’re trying to modify and search for the
string to find the source of the problem.
In A.03.15, A.01.23 and prior compiler versions, only floating-point constant values were
placed in read-only memory. Other constants and literals were placed in read-write memory.
HP aC++ continues to more strictly conform to the C++ Standard, enabling porting to
additional platforms. Due to closer conformance with the standard, you may see more compile
time warnings and errors.
Function Try Blocks as Defined in the C++ Standard
HP aC++ now provides function try blocks, as defined in the C++ Standard. Function try
blocks are sometimes necessary with class constructor destruction. A function try block is the
only means of ensuring that all exceptions thrown during the construction of an object are
caught within the constructor.
#assert and #unassert Preprocessor Directives
#assert and #unassert preprocessor directives allow you to set a predicate name or
predicate name and token to be tested with a #if directive. The -ext option must also be
specified at compile and link time.