Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Systems: HP C/HP-UX Release Notes > Chapter 1 HP C/HP-UX Release Notes

Problem Description and Fixes

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

This section details known defect fixes with accompanying CHART defect database numbers (when available) and workarounds for the HP C/ANSI C compiler. This information is provided by release version number, B.11.11.06.

Problems corrected in the final release of the HP C/ANSI C compiler will be referenced in the Software Status Bulletin.

Users with support contracts may access these bulletins and patch information from the HP SupportLine database on the World Wide Web located at one of the following URLs:

  • http://us-support.external.hp.com/

  • http://europe-support.external.hp.com/

Enhancements and Defect Fixes

This section describes enhancements and defect fixes in the HP ANSI C compiler. Version B.11.11.06 of the HP C/ANSI C compiler has the following enhancements/defects fixed:

  • JAGae13383: -mt option needed similar to aCC

  • JAGae20847: UTF-16 support for HP C compiler.

  • JAGae13389: Support for +ub option to make unqualified bit fields unsigned by default.

  • JAGad96950: Support for OpenMP single pragma with clauses.

Workarounds

The following are workaround solutions to previous problems with the HP C/ANSI C compiler:

  • +Onomoveflops should always be used with the +FPZ and +FPI floating point options. +Onomoveflops prevents floating point instructions from being moved, and replaces integer division by floating point multiply by the inverse.

  • If you intend to use GNU style variable argument macros in HP C, note that you can make the concatenation operator ## prevent syntax errors from occurring when the variable argument comes in as empty (the null string).

    However, you can also insert whitespace to the left of the left operand of ## to more accurately specify the intended left operand.

    For example, if you use

    #define foo(f, s...) printf(f, s)

    Then the macro call

    foo(“Hello world.\n”);

    results in the expansion

    printf(“Hello world.\n”,);

    (Note the comma ",") causing a syntax error.

    GNU provides the following workaround for this kind of a situation. If you use:

    #define foo(f, s...) printf(f, ## s)

    If the variable parameter s is non-null, and if you use:

    foo("%s %d\n", "Cycles", "1024");

    The result is:

    printf("%s %d\n", "Cycles", "1024");

    as the expansion as you would expect.

    However, if s is null, this erases the comma to the left of the ## in the macro definition and resulting expansion is:

    printf("Hello world.\n");

    Note that the comma is removed.

    In order to get the same behavior in HP C, you must insert a space to the left of the comma to make it clear to the preprocessor that the comma is the left operand of the ## operator. Thus your definition for the macro foo is:

    #define foo(f, s...) printf(f , ## s)
                                    ^

    (Note the space to the left of the ## operator in the macro definition.)

    If the space is not inserted, the left operand of the ## operator is understood to be:

    printf(f ,

    Because there is no parameter by that name for foo, it is erased.

    When specifying declarations within code in the HP C/ANSI C compiler, donot expect the same behavior in HP aC++. For the example:

    for(int i = 0; i < j; i ++) int i;

    Note the lack of a new block opening for the for statement. The C++ compiler accepts this form, with warnings, but the C compiler does not. The difference in the way the stack is handled causes the difference in behavior.

    Previously, the C compiler did not emit the source file information for the global typedefs. To correct this, use -y option along with -g when debug info is generated. You can generate debug information by compiling with +objdebug.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2003 Hewlett-Packard Development Company, L.P.