Skip navigation.
Home
The QNX Community Portal

View topic - C++ Preprocessor Memory Fault

C++ Preprocessor Memory Fault

Discussion about the QNX6 OS.

C++ Preprocessor Memory Fault

Postby qnx630 » Fri Jul 19, 2013 1:13 pm

Hi

Have a problem on with C++ preprocessor. After calling g++ -E main.cpp I get Memory fault (core dumped). C preprocessor works fine. Also QCC -E -Y _gpp main.cpp completes without errors. WTF?

Code: Select all
QNX vmware 6.3.0 2004/04/29-21:23:19UTC x86pc x86

Code: Select all
g++ (GCC) 3.3.1 (qnx-nto)
qnx630
Active Member
 
Posts: 10
Joined: Mon Jun 24, 2013 11:11 am

Re: C++ Preprocessor Memory Fault

Postby Tim » Fri Jul 19, 2013 2:16 pm

I've never seen 3.3.1. I only have 2.95.3 and 3.3.5 on my QNX 6.30 system.

My guess is that qcc and g++ are using different versions of the compiler. I've personally never used g++ from the command line, I only use qcc.

if you do a qcc -V from the command line, which is the default GNU compiler listed?
If you do a g++ -dumpversion from the command line what is the default compiler listed?

Tim
Tim
Senior Member
 
Posts: 1388
Joined: Wed Mar 10, 2004 12:28 am

Re: C++ Preprocessor Memory Fault

Postby qnx630 » Fri Jul 19, 2013 2:24 pm

Tim wrote:I've never seen 3.3.1. I only have 2.95.3 and 3.3.5 on my QNX 6.30 system.

My guess is that qcc and g++ are using different versions of the compiler. I've personally never used g++ from the command line, I only use qcc.

if you do a qcc -V from the command line, which is the default GNU compiler listed?
If you do a g++ -dumpversion from the command line what is the default compiler listed?

Tim


Thanks for reply.

Code: Select all
qcc -V
3.3.1,gcc_ntox86   (default)


Code: Select all
g++ -dumpversion
3.3.1
qnx630
Active Member
 
Posts: 10
Joined: Mon Jun 24, 2013 11:11 am

Re: C++ Preprocessor Memory Fault

Postby Tim » Fri Jul 19, 2013 6:50 pm

At least you are using the same versions.

I tried the command 'g++ -E test.cpp' on my 6.30 SP3 system on a file that's about 1000 lines long. It didn't crash but then I'm not using 3.3.1 either.

Interestingly the only thing it does is simply echo out the file line by line to the screen. Is that what it's supposed to do?

Maybe it crashes if your file is too large or contains a funny character. It may be core dumping under qcc as well but since qcc is running g++ in the background you may not be aware of it (you'd need to have dumper running and clear /var/dumps and then run the qcc command and see if a dump file gets created for g++).

Tim
Tim
Senior Member
 
Posts: 1388
Joined: Wed Mar 10, 2004 12:28 am

Re: C++ Preprocessor Memory Fault

Postby qnx630 » Mon Jul 22, 2013 5:36 am

Tim wrote:At least you are using the same versions.

I tried the command 'g++ -E test.cpp' on my 6.30 SP3 system on a file that's about 1000 lines long. It didn't crash but then I'm not using 3.3.1 either.

Interestingly the only thing it does is simply echo out the file line by line to the screen. Is that what it's supposed to do?

Maybe it crashes if your file is too large or contains a funny character. It may be core dumping under qcc as well but since qcc is running g++ in the background you may not be aware of it (you'd need to have dumper running and clear /var/dumps and then run the qcc command and see if a dump file gets created for g++).

Tim


Yes, it should simply echo out the file line by line. I'm using very small file with a few lines of code so it can't be a reason of crashing.
qnx630
Active Member
 
Posts: 10
Joined: Mon Jun 24, 2013 11:11 am

Re: C++ Preprocessor Memory Fault

Postby Tim » Mon Jul 22, 2013 4:46 pm

I dunno then. Something's definitely broken in 3.3.1.

The question is does it really matter that much? You can easily accomplish what you want with qcc.

Tim
Tim
Senior Member
 
Posts: 1388
Joined: Wed Mar 10, 2004 12:28 am

Re: C++ Preprocessor Memory Fault

Postby qnx630 » Tue Jul 23, 2013 5:51 am

Tim wrote:I dunno then. Something's definitely broken in 3.3.1.

The question is does it really matter that much? You can easily accomplish what you want with qcc.

Tim


Sure, you are right but this error is annoying during compiling some FOS software and probably can be the reason of failed compilation. Anyway, thanks for the help.
qnx630
Active Member
 
Posts: 10
Joined: Mon Jun 24, 2013 11:11 am


Return to QNX6 - OS

Who is online

Users browsing this forum: No registered users and 1 guest

cron