Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-472

[HP aCC 3.77/HP-UX 11.11] <wchar.h> missing declarations

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.1.3
    • Fix Version/s: None
    • Component/s: 21. Strings
    • Labels:
      None
    • Environment:

      HP aCC 3.77/HP-UX 11.11

      Description

      The test below attempts to exhaustively exercise the synopsis of the <wchar.h> header. With stdcxx it fails to compile with HP aCC 3.77 on HP-UX 11.11 even though it compiles when using the native C++ Standard Library (with the -AA compiler option):

      $ cat t.cpp && uname -sr && aCC -V && gmake t
      #include <wchar.h>

      #ifndef NULL

      1. error NULL not #defined
        #endif

      #ifndef WCHAR_MAX

      1. error WCHAR_MAX not #defined
        #endif

      #ifndef WCHAR_MIN

      1. error WCHAR_MIN not #defined
        #endif

      #ifndef WEOF

      1. error WEOF not #defined
        #endif

      #ifdef __cplusplus
      extern "C" {
      #endif

      void test_signatures ()
      {
      mbstate_t state;
      wint_t wint;
      size_t size;
      struct tm t;

      &fgetwc;
      &fgetws;
      &fputwc;
      &fputws;
      &fwprintf;
      &fwscanf;
      &getwc;
      &getwchar;
      &mbrlen;
      &mbrtowc;
      &mbsinit;
      &mbsrtowcs;
      &putwc;
      &putwchar;
      &swprintf;
      &swscanf;
      &ungetwc;
      &vfwprintf;
      &vwprintf;
      &wcrtomb;
      &wcscat;

      #ifdef __cplusplus

      { wchar_t* (*pf)(wchar_t*, wchar_t) = &wcschr; } { const wchar_t* (*pf)(const wchar_t*, wchar_t) = &wcschr; }

      #else
      &wcschr;
      #endif

      &wcscmp;
      &wcscoll;
      &wcscpy;
      &wcscspn;
      &wcslen;
      &wcsncat;
      &wcsncmp;
      &wcsncpy;

      #ifdef __cplusplus

      { wchar_t* (*pf)(wchar_t*, const wchar_t*) = &wcspbrk; } { const wchar_t* (*pf)(const wchar_t*, const wchar_t*) = &wcspbrk; } { wchar_t* (*pf)(wchar_t*, wchar_t) = &wcsrchr; } { const wchar_t* (*pf)(const wchar_t*, wchar_t) = &wcsrchr; }

      #else
      &wcspbrk;
      &wcsrchr;
      #endif

      &wcsrtombs;
      &wcsspn;

      #ifdef __cplusplus

      { wchar_t* (*pf)(wchar_t*, const wchar_t*) = &wcsstr; } { const wchar_t* (*pf)(const wchar_t*, const wchar_t*) = &wcsstr; }

      #else
      &wcsstr;
      #endif

      &wcstod;
      &wcstok;
      &wcstol;
      &wcstoul;
      &wcsxfrm;
      &wctob;

      #ifdef __cplusplus

      { wchar_t* (*pf)(wchar_t*, wchar_t, size_t) = &wmemchr; } { const wchar_t* (*pf)(const wchar_t*, wchar_t, size_t) = &wmemchr; }

      #else
      &wmemchr;
      #endif

      &wmemcmp;
      &wmemcpy;
      &wmemmove;
      &wmemset;
      &wprintf;
      &wscanf;
      }

      #ifdef __cplusplus
      } // extern "C"
      #endif

      int main ()
      {
      test_signatures ();
      }
      HP-UX B.11.11
      aCC: HP ANSI C++ B3910B A.03.77
      aCC -c -I/house/sebor/stdcxx-2007-06-28-r551753/include/ansi -I/usr/include -D_RWSTDDEBUG -mt -I/house/sebor/stdcxx-2007-06-28-r551753/include -I/house/sebor/build/stdcxx-2007-06-28-r551753-aCC-3.77-15s/include -I/house/sebor/stdcxx-2007-06-28-r551753/examples/include -Aa +nostl -g +d +w +W392 +W655 +W684 +W818 +W819 +W849 t.cpp
      Error 119: "t.cpp", line 8 # #error WCHAR_MAX not #defined

      1. error WCHAR_MAX not #defined
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        Error 119: "t.cpp", line 12 # #error WCHAR_MIN not #defined
      2. error WCHAR_MIN not #defined
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        Error 419: "t.cpp", line 25 # 'mbstate_t' is used as a type, but has not been
        defined as a type.
        mbstate_t state;
        ^^^^^^^^^
        Error 403: "t.cpp", line 34 # Undeclared variable 'fwprintf'. Perhaps
        'fprintf' as in "int fprintf(FILE *,const char *,...)"
        ["/usr/include/../include/stdio.h", line 233] was intended.
        &fwprintf;
        ^^^^^^^^
        Error 403: "t.cpp", line 35 # Undeclared variable 'fwscanf'. Perhaps 'fscanf'
        as in "int fscanf(FILE *,const char *,...)"
        ["/usr/include/../include/stdio.h", line 234] was intended.
        &fwscanf;
        ^^^^^^^
        Error 403: "t.cpp", line 38 # Undeclared variable 'mbrlen'. Perhaps 'mblen' as
        in "int mblen(const char *,unsigned long)"
        ["/usr/include/../include/stdlib.h", line 122] was intended.
        &mbrlen;
        ^^^^^^
        Error 403: "t.cpp", line 39 # Undeclared variable 'mbrtowc'. Perhaps 'mbtowc'
        as in "int mbtowc(wchar_t *,const char *,unsigned long)"
        ["/usr/include/../include/stdlib.h", line 123] was intended.
        &mbrtowc;
        ^^^^^^^
        Error 172: "t.cpp", line 40 # Undeclared variable 'mbsinit'.
        &mbsinit;
        ^^^^^^^
        Error 403: "t.cpp", line 41 # Undeclared variable 'mbsrtowcs'. Perhaps
        'mbstowcs' as in "unsigned long mbstowcs(wchar_t *,const char *,unsigned
        long)" ["/usr/include/../include/stdlib.h", line 125] was intended.
        &mbsrtowcs;
        ^^^^^^^^^
        Error 403: "t.cpp", line 44 # Undeclared variable 'swprintf'. Perhaps
        'sprintf' as in "int sprintf(char *,const char *,...)"
        ["/usr/include/../include/stdio.h", line 237] was intended.
        &swprintf;
        ^^^^^^^^
        Error 403: "t.cpp", line 45 # Undeclared variable 'swscanf'. Perhaps 'sscanf'
        as in "int sscanf(const char *,const char *,...)"
        ["/usr/include/../include/stdio.h", line 238] was intended.
        &swscanf;
        ^^^^^^^
        Error 403: "t.cpp", line 47 # Undeclared variable 'vfwprintf'. Perhaps
        'vfprintf' as in "int vfprintf(FILE *,const char *,double *)"
        ["/usr/include/../include/stdio.h", line 570] was intended.
        &vfwprintf;
        ^^^^^^^^^
        Error 699: "t.cpp", line 47 # Error limit reached; halting compilation.
        &vfwprintf;
        ^^^^^^^^^

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sebor Martin Sebor
                Reporter:
                sebor Martin Sebor
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: