Operating System - HP-UX
1830169 Members
4875 Online
109999 Solutions
New Discussion

aCC 6.29 possible defect in compiler /opt/gnustl/include/bits/cpp_type_traits.h

 
JEsker
Occasional Advisor

aCC 6.29 possible defect in compiler /opt/gnustl/include/bits/cpp_type_traits.h

We are trying to build the ICU Unicode package, whcih requires support for C++11.  We have aCC 6.29 with patch PHSS_44416 installed to enable gnustl usage.   

======== Rebuilding "stubdata.o" ========
aCC -DU_ATTRIBUTE_DEPRECATED= -D_REENTRANT -D_THREAD_SAFE -DU_HAVE_ELF_H=1 -DU_HAVE_STRTOD_L=0 -DU_HAVE_LIB_SUFFIX=1 -DU_LIB_SUFFIX_C_NAME=_ratl -I../common -O +DD64 +std=c++11 +stl=gnu +W612 -DATRIA_CXX_11 -mt -Wc,-ansi_for_scope,on +W740 +W749 +W823 +W4232 -c +Z -o stubdata.o stubdata.cpp
"/vobs/sys_tools/HPUX11_IA64/aCC6.29_cc11.31/opt/gnustl/include/bits/cpp_type_traits.h", line 99: error #2029: expected an expression
enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };

The compiler throws an error on definitions in its own header files.  This same construct in the ICU code compiles fine on Solaris, AIX using their native compilers, and LInux using gcc. This does not appear to be an issue with the header file being out of date, I compared to the same header file in Solaris which is several years newer, but the code in question is identical.   This seems like a bug in the compiler to me.  

 

 

5 REPLIES 5
Sunitha_Mod
Honored Contributor

Re: aCC 6.29 possible defect in compiler /opt/gnustl/include/bits/cpp_type_traits.h

Hello @JEsker,

Thank you for posting. 

Could you please let us know which HPE product you are referring to? So we can move to the correct board. 

JEsker
Occasional Advisor

Re: aCC 6.29 possible defect in compiler /opt/gnustl/include/bits/cpp_type_traits.h

We are using the HP aC++/HP ANSI C A.06.29 compiler, on HP-UX 11.31 on IA64.

I apologize for not knowing best place to post my question.

 

 

 

JEsker
Occasional Advisor

Re: aCC 6.29 possible defect in compiler /opt/gnustl/include/bits/cpp_type_traits.h

Using same compiler, comparing both the header trace (-H)  and the pre-processed code (-E) for two different sources (in different bodies of code),
I have this observation.
In the code where we get this error:

"/vobs/sys_tools/HPUX11_IA64/aCC6.29_cc11.31/opt/gnustl/include/bits/cpp_type_traits.h", line 99: error #2029: expected an expression
enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };
^
The preprocessed code shows this:

namespace __gnu_cxx
{
template<typename _Iterator, typename _Container>
class __normal_iterator;
}

namespace std
{
struct __true_type { };
struct __false_type { };

template<_Bool>
struct __truth_type
{ typedef __false_type __type; };

template<>
struct __truth_type<1>
{ typedef __true_type __type; };

template<class _Sp, class _Tp>
struct __traitor
{
enum { __value = _Bool(_Sp::__value) || _Bool(_Tp::__value) };
typedef typename __truth_type<__value>::__type __type;
};

In a different source, which compiles without that error, the preprocessed code looks like this:

namespace __gnu_cxx
{
template<typename _Iterator, typename _Container>
class __normal_iterator;
}

namespace std
{
struct __true_type { };
struct __false_type { };

template<bool>
struct __truth_type
{ typedef __false_type __type; };

template<>
struct __truth_type<true>
{ typedef __true_type __type; };

template<class _Sp, class _Tp>
struct __traitor
{
enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };
typedef typename __truth_type<__value>::__type __type;
};


Because they are in completely different bodies of code, the header file traces are substantially different, but the
one possibly relevant observation I found is that in the case which generates the error, stdbool.h has been included before cpp_type_traits.h
while in the case that compiles without error, stdbool.h has not been included.

To further test this observation, I modified that other source to specifically include stdbool.h before including <memory>.
And, now that module also gets the compilation error, and I see another instance of same error, on a line of code also involving bool, and also in a header file in the compiler installation

"/vobs/sys_tools/HPUX11_IA64/aCC6.29_cc11.31/opt/gnustl/include/ostream", line 429: error #2029: expected an expression
if (bool(_M_os.flags() & ios_base::unitbuf) && !uncaught_exception())

And further confirmed in preprocessed code that _Bool is  generated.

 

georgek_1
HPE Pro

Re: aCC 6.29 possible defect in compiler /opt/gnustl/include/bits/cpp_type_traits.h

Hello JEsker,

 

It may need further checking , probably require the involvement of Product Engineering team . 

Requesting you to contact HPE Support Center and raise a ticket to get it checked further .

 

I work for HPE/ I am an HPE Employee (HPE Community)



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
JEsker
Occasional Advisor

Re: aCC 6.29 possible defect in compiler /opt/gnustl/include/bits/cpp_type_traits.h

Unfortunately, I am not able to open a ticket.