Operating System - Linux
1830207 Members
1989 Online
109999 Solutions
New Discussion

Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

 
SOLVED
Go to solution
Neel2
Regular Advisor

Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hi,

While building C++ program on HP-UX B.11.23 U ia64, using aCC 06.15 compiler version. I got the following errors:

"/usr/include/machine/sys/_types.h", line 65: error #20: identifier "__fpreg"
is undefined
__fpreg __for_alignment_only_do_not_use;
^

"/usr/include/stdio.h", line 130: error #20: identifier "__va_list__" is
undefined
typedef __va_list__ __va_list;
^

"/usr/include/stdio.h", line 543: error #20: identifier "__va_list__" is
undefined
typedef __va_list__ va_list;
^

"/usr/include/stdlib.h", line 574: error #20: identifier "__float80" is
undefined
extern char *_extecvt(__float80, int, int *, int *);
^

"/usr/include/stdlib.h", line 574: error #18: expected a ")"
extern char *_extecvt(__float80, int, int *, int *);
^

"/usr/include/stdlib.h", line 575: error #18: expected a ")"
extern char *_extfcvt(__float80, int, int *, int *);
^

"/vobs/cxx/h.cih/cxxcls/typedef.h", line 57: catastrophic error #5: could not
open source file "new.h"
#include
^

Any suggestions would be appreciated.

Thanks,
Neel
61 REPLIES 61
Dennis Handly
Acclaimed Contributor

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

You are NOT using aCC6. The error messages are close but not correct.
Compile with -v and provide that output.

Neel2
Regular Advisor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Yes, we are compiling using third party front end compiler. And we got the support from them and resolve the issue. Secondly, using the same compiler we create a cpp file, and we compiled with aCC6.

And we got the following error:
//=========================================
"fund.cxx", line 11142: error #3449: explicit specialization of member
"PClassObject::pco_State [with X=PObject]" must precede its first
use (at line 47 of "/vobs/cxx/h.cih/cxxcls/template/pclass.h")
PClassObject< PObject >::pco_State = {

//==========================================

Command line:
aCC -c -D_REENTRANT -mt -g0 +DD32 +Z -I/...
/cxx/fund/fund.cxx

I tried to use "+inst_implicit_include" compile time flag to resolve the error, but not use.

fund.cxx file snippet with line no.
11139 template <>
11140 void PClassObject< PObject >::vpp_delete(void *XXX) { delete(::PObject *)XXX; }
11141 template<> PClass
11142 PClassObject< PObject >::pco_State = {
11143 (void*) 0, /* next */
11144 "PObject", /* shortName */
11145 "", /* longName */
11146 "", /* idName */
11147 (o_object *)0, /* o_clsobj */
11148 sizeof(::PObject), /* inst_size */
11149 (void *)0, /* initVal */
11150 (void *)0, /* offset */
11151 0L, /* class number */
11152 (struct PWSlot *)PObject___Wslots,
11153 (struct PLSlot *)PObject___Lslots,
11154 (struct PVSlot *)PObject___Vslots,
11155 (struct PMSlot *)PObject___Mslots,
11156 (struct PSuperOffset *)PObject___supers,
11157 0x248be37b, /* signature */
11158 0x54637281, /* magic */
11159 (void *)0,
11160 PClassObject< ::PObject >::vpp_delete,
11161 ::PObject::_V_class_layout,
11162 ::PObject::_V_activate,
11163 0, /* aList == 0 */
11164 ::PObject::get_PObject,
11165 0, /* next_slot */
11166 0, /* tSize */
11167 0, /* wSize */
11168 (struct PTSlot *)0, /* tCopy */
11169 (struct PWSlot *)0, /* wCopy */
11170 0, /* pc_flags */
11171 0, /* activate */
11172 0, /* deactivate */
11173 0 /* init */
11174 };


And the header file pclass.h file snippet:

37 template
38 class PClassObject {
39 public:
40 static PClass& Object() { return pco_State; }
41 static PClass* Pointer() { return &pco_State; }
42
43 // we add the following function so that customer can have
44 // a workaround for the bug in Sun C++ 3.0
45
46 static PClass& get_Object() { return pco_State; }
47 static PClass* get_Pointer() { return &pco_State; }
48
49 static VPP_IMPORT_PCLASS PClass pco_State; // inter
nal use only
50 static VPP_IMPORT_PCLASS PClassWakeup pcwo_Object; // inter
nal use only
51 static void vpp_delete(void*);
52 };


Will appreciate your quick reply on the above discussed issue.

Thanks in advance for the response.
Neel.


Dennis Handly
Acclaimed Contributor

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

>we are compiling using third party front end compiler.

No wonder it looked almost the same.

"fund.cxx", line 11142: error #3449: explicit specialization of member "PClassObject::pco_State [with X=PObject]" must precede its first use (line 47 of "pclass.h")
PClassObject< PObject >::pco_State = {

This is saying that you need to move the explicit specialization of pco_State before its first use. Or you need to move it before the definition of PClassObject

>I tried to use "+inst_implicit_include" compile time flag to resolve the error, but not use.

This is an obsolete cfront template coding style option, you shouldn't use it.

>fund.cxx file snippet with line no.
>And the header file pclass.h file snippet:

What is the relative ordering of these in the .i file?

>Will appreciate your quick reply on the above discussed issue.

I'm probably going to need a .i file from this source, if it isn't obvious how to reorder things.

You can look at how aC++ does it by looking at the explicit specializations in <string>:
// basic_string<...>::__nullref
#if !defined(_RWSTD_NO_STATIC_DEF3) && !defined(_HP_INSTANTIATE_IN_LIB)
template <>
const basic_string, allocator >::_C_null_ref_type basic_string, allocator >::__nullref;

Neel2
Regular Advisor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hi Dennis,

Thanks for the reply. I will try to change, and if I find any difficulty will send you a.i file.

Thanks,
Neel.
Neel2
Regular Advisor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hi Dennis,

Please find attached .i file for reference.

Best regards,
Neel
Dennis Handly
Acclaimed Contributor

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

#line 125 "/vobs/cxx/h.cih/cxxcls/typedef.h"
template < class X > class PClassObject;
Declared, page 74.

#line 37 "/vobs/cxx/h.cih/cxxcls/template/pclass.h"
template < class X >
class PClassObject {
static PClass pco_State;
Defined, page 127

#line 10942 "fund.cxx"
...
PClassObject< PObject >::pco_State = {
Defined, this is roughly on page 202.

You are going to have to move all of your explicit specializations in func.cxx after the include for pclass.h.

Neel2
Regular Advisor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hi Dennis,

Could you please show me a small example, which will help me to understand How to move explicit specialization after pclass in fund.cxx file.

Thanks,
Neel
Dennis Handly
Acclaimed Contributor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

>Could you please show me a small example, which will help me to understand how to move explicit specialization after pclass in fund.cxx file.

The small example was in for basic_string::__nullref that I mentioned above.

template <class x>
class PClassObject {
static PClass pco_State;
...
};

template <>
PClassObject::pco_State = { ... };

Basically the explicit specialization for the template class static data member pco_State must be right after the definition of the template class PClassObject.
(Or it must be before its first use.)

You have several other explicit specializations of pco_State that will also need to be moved up.

Dennis Handly
Acclaimed Contributor
Solution

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

Ok, I fiddled with your .i file and looked at the Standard. You just need to put explicit specialization forwards after the definition of class PClassObject:

// Add explicit specialization forwards
class PObject;
class PVirtual;
class PBiLinkVstr;
class VAssociate;
class Container;
class VString;
class PBiLink;
template <>
PClass PClassObject::pco_State;
template <>
PClass PClassObject::pco_State;
template <>
PClass PClassObject::pco_State;
template <>
PClass PClassObject::pco_State;
template <>
PClass PClassObject::pco_State;
template <>
PClass PClassObject::pco_State;
template <>
PClass PClassObject::pco_State;

Neel2
Regular Advisor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hi Dennis,

I put the explicit specialization forwards in fund.cxx, and the file got compile succesfully with aCC6, Now i will search the exact location in pclass.h or any other to put these forwards.

Thank you very much for your help.

Best regards,
Neel
Dennis Handly
Acclaimed Contributor

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

>Now i will search the exact location in pclass.h or any other to put these forwards.

If it compiles, you pretty much got the right place.
I found I could move PClassObject::pco_State right after the class PObject but not much farther.

Neel2
Regular Advisor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hi Dennis,

I tried to put forwards in pclass.h file right after the class declaration, and things got compiled, after going ahead with compilation, i got the following errors:

//***************************************//
"vset1.cxx", line 11478: error #3449: explicit specialization of member
"PClassObject::pco_State [with X=VESet>]" must
precede its first use (at line 47 of
"/vobs/cxx/h.cih/cxxcls/template/pclass.h")
PClassObject< VESet< Link< PObject> > >::pco_State = {



then i try to declare VESet in forwards but it doesn't work.

Any pointers would be helpfull.

Best regards,
Neel
Dennis Handly
Acclaimed Contributor

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

>I got the following errors:
"vset1.cxx", line 11478: error #3449: explicit specialization of member
"PClassObject::pco_State" must precede its first use (at line 47 of pclass.h)
PClassObject > >::pco_State

>then I try to declare VESet in forwards but it doesn't work.
>Any pointers would be helpful.

I'm going to have to have another .i file. You probably need to put the forward right after the VESet definition.

Neel2
Regular Advisor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hi Dennis,

I tried after VESet, as suggested by you. Also tried to put VESet forward dec. in pclass.h, but could not help.

Attached is the .i file for your kind reference.

Please suggest.

Best regards,
Neel
Dennis Handly
Acclaimed Contributor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

You have a problem with your layout. You have the PClassObject template class in pclass.h.

Then your explicitly specialize it in your .C files.

Ideally you should include pclass.h from your .C then add your explicit specialization forwards in the .C. Then include more .h files then finally your explicit specializations in the .C.

It turns out if you just use PClassObject, you can just put them all after PClassObject. But if you have nested templates, you need to put them after the outer level is defined.

Unfortunately that maybe too late since you have:
template
class outer {
...
};

Insert here??
// Then immediate use of outer and PClassObject.

Perhaps it isn't as difficult as I made it?
In your source you have:
#line 10947 "vset1.cxx"
...
// Add it here!
template <>
PClass PClassObject > >::pco_State;

// First "use" of VESet >
template<>
inline VESet< Link< PObject> > ::VESet(_V_ACT *)
: VCollection((_V_ACT *)0)
, members((_V_ACT *)0)
, table((_V_ACT *)0)
, links((_V_ACT *)0)
{}



Neel2
Regular Advisor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

i Dennis,

Thanks for your investigation. I am happy to say that forward dec. is working.

My curiosity, what type of significance changes has been done with new aCC compiler, to handle this kind of layout? why I need to change my template declaration in source code order to build with new one, since i was working with the old one w/o changes?

Appreciate your answer and would be great helpfull for me to understand that what kind of recent changes done for handling templates in new compiler desing?

Best regards,
Neel
Dennis Handly
Acclaimed Contributor

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

>what type of significance changes has been done with new aCC compiler, to handle this kind of layout? why I need to change my template declaration in source code order to build with new one, since i was working with the old one w/o changes?

Because aCC6 is based on EDG, which is perfect. :-)
It meets the strict interpretation of the Standard in regards to point of instantiation, etc.

>recent changes done for handling templates in new compiler design?

Recent when? From aCC3/aCC5 to aCC6? Or versions of aCC6?

Neel2
Regular Advisor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined


Nice joke ;-)

>> It meets the strict interpretation of the Standard in regards to point of instantiation, etc.

Could you please provide me some more information, Also do we have some flag/s which will take of the above strict interpretation etc. OR Can you please send me some links which describes the above scenario.

>>Recent when? From aCC3/aCC5 to aCC6? Or versions of aCC6?

from aCC3.57 ??

Best regards,
Neel
Dennis Handly
Acclaimed Contributor

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

>Could you please provide me some more information, Also do we have some flag/s which will take of the above strict interpretation etc. OR Can you please send me some links which describes the above scenario.

Well, there is the C++ Standard.
aCC6 is already non-strict by default.
Here is the aCC5 to aCC6 porting link:
http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=2708d7c682f02110d7c682f02110275d6e10RCRD

Error 3449 isn't listed because aCC5 was also suppose to flag that as an error.

Neel2
Regular Advisor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hello Dennis,

Thanks a ton. The link is really helpfull for porting.

I quickly went thru and found same error described, at ISO-22. No storage class on template specialization (2080)

Where they have suggested to remove the static storage keyword to work on both compilers. It is correct way to solve the my bunch of errors?

OR I should use -W2759 on the command line according to ISO-42.

Best regards,
Neel

Dennis Handly
Acclaimed Contributor

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

>I quickly went thru and found same error described, at ISO-22. No storage class on template specialization (2080)
>It is correct way to solve the my bunch of errors?

This wasn't your problem, error 3449. You didn't have static there.

>OR I should use -W2759 on the command line according to ISO-42.

You don't have that either. (Unfortunately there is a typo, it should be +Ww2759.)

Neel2
Regular Advisor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hi Dennis,

Thanks for your input. So I just want to know, to get rid of error #3449 explicit specialization of member...Is it un-avoidable with aCC6, there is no backward-compatibility? then what should be the best way to resolve the above error?

1.
Can I use some flag(command line)which will take care of the above discussed issue.

2. Do I need to start changing all source code files, ( which is itself huge no. of files) just becuase we have change the compiler version ?

3. What best available options are there to solve the above error ? your suggestions are always welcome.

Best regards,
Neel



Neel2
Regular Advisor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hi Dennis,

Thanks for your input. So I just want to know, to get rid of error #3449 explicit specialization of member...Is it un-avoidable with aCC6, there is no backward-compatibility? then what should be the best way to resolve the above error?

1.
Can I use some flag(command line)which will take care of the above discussed issue.

2. Do I need to start changing all source code files, ( which is itself huge no. of files) just becuase we have change the compiler version ?

3. What best available options are there to solve the above discusse issue, since you the complete issue? your suggestions are always welcome.

Best regards,
Neel



Neel2
Regular Advisor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hi Dennis,

Thanks for your valuable inputs. So I just want to know, to get rid of error #3449 explicit specialization of member...Is it un-avoidable with aCC6, there is no backward-compatibility? then what should be the best way to resolve the above error?

1.
Can I use some flag(command line)which will take care of the above discussed issue.

2. Do I need to start changing all source code files, ( which is itself huge no. of files) just becuase we have change the compiler version ?

3. What best available options are there to solve the above discusse issue, since you the complete issue? your suggestions are always welcome.

Best regards,
Neel