g++pentium 2.9 compiler problem

Hi All, I am facing one of the typical scenario in the Tornado

2.2.1/vxWorks 5.5.1 g++pentium 2.9 compiler. This Compiler is not initialising properly any of the member array of function pointers either 1-dimensional or 2-dimensional. For this problem i got a solution from windriver because it is one of the SPR'S it's number : 110843 so i installed the Service Patch: Tornado 2.2.1 Service Pack 1 (Tornado 2.2.1 Cumulative Update Patch). This will update my Tornado version to 2.2.2(earlier 2.2.1) & vxWorks to 5.5.2(earlier 5.5.1). I thought problem will get resolved after this. But the thing is i am still facing the same problem.

Source Code:

#include

using namespace std;

class test; typedef void (test::*fp)(); class test { public: void f1(); void f2(); void f3(); void f4(); void f5(); void f6(); void f7(); void f8(); static fp fptr[4][2]; void f();

};

fp test::fptr[4][2]= { {&test::f1,&test::f2}, {&test::f3,&test::f4}, {&test::f5,&test::f6}, {&test::f7,&test::f8}

};

void test::f() { for(int i=0; i

Reply to
samrat
Loading thread data ...

Of course it does not. You defined an array of pointers to the poiters to the functions. What do you expect?

Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

No helpful s/w has service patches

nor service packs . Its bait , they have

you on the hook , you'll spend the

next 2 years trying to make it work ,

and they laugh at you !

The easiest way is to start at the bottom

and write it yourself , this way you wont

bloat it , since its for YOU , and not

a paycheck ..

Reply to
werty

Hi Vladimir,

It's very nice to see u'r reply. Also Vladimir i got struct with this problem for a very long time. Also i need u'r help to solve this problem. i m expecting a suggestion from u'r side, like is there any other alternate method to solve this.

regards, sakthivel

Reply to
samrat

My dear friend,

Congratulations, you have found the right person. Solving the problems is what I do for living. Your problem is very tough and challenging. It would be my pleasure to help you for the small monetary reward. The email address is at the web site.

Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

... snip ...

Please don't use silly abbreviations such as u'r.

--
 
 
 
 
 "A man who is right every time is not likely to do very much."
                           -- Francis Crick, co-discover of DNA
 "There is nothing more amazing than stupidity in action."
                                             -- Thomas Matthews
Reply to
CBFalconer

Nope. That looks like a pretty normal two-dimensional array of member function pointers to me. DJGPP g++ 2.8.1 agrees (the closest to "g++ 2.9" I have here), and generates correct code. Same goes for MinGW g++ 3.4.4 and Borland C++ 5.5.1.

I don't know what your "ldpentium" does. I miss some linking with standard libraries here, and I wonder what that '-r' option does. For the linkers I know, '-r' is used for intermediate linking steps only, not for the final one. But then, I don't know your operating system (and for a Linux kernel module, -r would be right).

Stefan

Reply to
Stefan Reuther

It works with VC (VS 2003) and GCC 3.2.2 as well. Also, based on deciphering the original post, the code works if the IDE is used to create a project and build the image. It only fails when the image is created using the command line tools. This clearly indicates, to me at least, that the OP is missing some tool configuration.

To the OP: Please check your tool chain documentation. I am reasonably sure that the answer is in the documentation. One thing that might be missing in the command line is the memory range. Another possibility is that some required libraries are not linked.

Also, this is a good question to ask the support team at Wind River.

Have a nice day, Pradeep

--
All opinions are mine and do not represent the views or
policies of my employer.
R Pradeep Chandran                 rpc AT pobox DOT com
Reply to
R Pradeep Chandran

Hi Pradeep, When i followed the same procedure to create the "a.out" executable in case of PowerPC target my sample code is working fine without any issues. Steps i used in PPC Board:

1) g++ppc -c sample.cpp 2) ldppc -r sample.o 3) "a.out" i will get.

Problem is happening only in case of this version of "g++pentium 2.9 Compiler". I sent a report regarding this problem to windriver, but i didn't find any response from their side.

The "g++ppc compiler version is 2.96" the vxworks version is still the same as vxWorks 5.5.1 which i use for the pentium target. i do know how to resolve this issue.

Regards, Samrat

Reply to
samrat

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.