This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Gcc problem on HP Unix


Hi,everybody.
   I compiled this program under HPPA 9000 system
,with gcc 3.0.There's neither error nor warning during
the compile process.But when I ran it,segmentation
fault happened and the program terminated.
 
Here is the program:
#include <stdio.h>
#include <string>
using namespace std;
 
class mapnode     
{
 string srcName,desName;
};
 
int main()
{
 fprintf(stderr,"Before mapnode constructor\n");
 mapnode a[2000];
 fprintf(stderr,"Mapnode constructor accomplished\n");
 return 1;
}
 
And my compile option: g++ main.cpp

I ran this program on Solaris and Linux,everything is
OK.I am sure the error is related with the array
because it's too large.But I can't believe the system
could not provide less than 10KB memory for this array.

_________________________________________________________
Do You Yahoo!? 登录免费雅虎电邮! http://mail.yahoo.com.cn

<font color=#6666FF>无聊?郁闷?高兴?没理由?都来聊天吧!</font>—— 
雅虎全新聊天室! http://cn.chat.yahoo.com/c/roomlist.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]