[Bug libstdc++/17005] wide character strings don't work on HP-UX 11i using gcc 3.4.1

dave at hiauly1 dot hia dot nrc dot ca gcc-bugzilla@gcc.gnu.org
Sat Aug 14 18:16:00 GMT 2004


------- Additional Comments From dave at hiauly1 dot hia dot nrc dot ca  2004-08-14 18:16 -------
Subject: Re:  wide character strings don't work on HP-UX

> I have a patch for the va_list problem under test.

http://gcc.gnu.org/ml/gcc-patches/2004-08/msg00960.html

> I'm not sure about _INCLUDE__STDC_A1_SOURCE.

The enclosed patch adds the C99 wide character support to the default
GCC namespace except when using C89.  This enables the wide character
specializations when libstdc++ is built.  However, the patch as it
currently stands introduces four regressions in the libstdc++ testsuite:

FAIL: 22_locale/time_put/put/wchar_t/1.cc execution test
FAIL: 22_locale/time_put/put/wchar_t/10.cc execution test
FAIL: 22_locale/time_put/put/wchar_t/5.cc execution test
FAIL: 22_locale/time_put/put/wchar_t/9.cc execution test

I looked at the first one a bit:

Assertion failed: result1 == L"Sun", file /test/gnu/gcc-3.3/gcc/libstdc++-v3/tes
tsuite/22_locale/time_put/put/wchar_t/1.cc, line 53
FAIL: 22_locale/time_put/put/wchar_t/1.cc execution test

The wchar_t * in result1 is null.  I'm not sure why.

With this change, the testcase will build under HP-UX 11i.  However,
it's not going to fix the problem on earlier HP-UX 11 releases.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

Index: config/pa/pa-hpux11.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa-hpux11.h,v
retrieving revision 1.14
diff -u -3 -p -r1.14 pa-hpux11.h
--- config/pa/pa-hpux11.h	27 Apr 2004 00:12:30 -0000	1.14
+++ config/pa/pa-hpux11.h	14 Aug 2004 17:40:50 -0000
@@ -24,7 +24,12 @@ Boston, MA 02111-1307, USA.  */
    the definition of __cplusplus.  We define _INCLUDE_LONGLONG
    to prevent nlist.h from defining __STDC_32_MODE__ (no longlong
    support).  We define __STDCPP__ to get certain system headers
-   (notably assert.h) to assume standard preprocessor behavior in C++.  */
+   (notably assert.h) to assume standard preprocessor behavior in C++.
+
+   The C99 support is incomplete.  We define _INCLUDE__STDC_A1_SOURCE
+   to provide the extended multibyte and wide-character utilities available
+   under HP-UX 11i.  Defining _HPUX_SOURCE would give us some more
+   features but it also adds stuff that isn't in C99.  */
 #undef TARGET_OS_CPP_BUILTINS
 #define TARGET_OS_CPP_BUILTINS()				\
   do								\
@@ -41,6 +46,7 @@ Boston, MA 02111-1307, USA.  */
 	  {							\
 	    builtin_define ("_HPUX_SOURCE");			\
 	    builtin_define ("_INCLUDE_LONGLONG");		\
+	    builtin_define ("_INCLUDE__STDC_A1_SOURCE");	\
 	    builtin_define ("__STDC_EXT__");			\
 	    builtin_define ("__STDCPP__");			\
 	  }							\
@@ -49,6 +55,7 @@ Boston, MA 02111-1307, USA.  */
 	    if (!flag_iso)					\
 	      {							\
 		builtin_define ("_HPUX_SOURCE");		\
+		builtin_define ("_INCLUDE__STDC_A1_SOURCE");	\
 		if (preprocessing_trad_p ())			\
 		  {						\
 		    builtin_define ("hp9000s800");		\
@@ -62,6 +69,10 @@ Boston, MA 02111-1307, USA.  */
 		else						\
 		  builtin_define ("__STDC_EXT__");		\
 	      }							\
+	    else if (flag_isoc99)				\
+	      {							\
+		builtin_define ("_INCLUDE__STDC_A1_SOURCE");	\
+	      }							\
 	    if (!TARGET_64BIT)					\
 	      builtin_define ("_ILP32");			\
 	  }							\


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17005



More information about the Gcc-bugs mailing list