LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
Search this Thread
Old 04-19-2011, 03:27 PM   #1
dimaloma
LQ Newbie
 
Registered: Apr 2011
Posts: 2

Rep: Reputation: 0
difference between gcc 3.4.1 and 4.2.0


My apologies if this is the wrong forum for my question
We recently switched from arm cross compiler g++ v3.4.1 to v4.2.0.
One of our structures had variable "index", and constructor had something like this: foo(): index(0){}
This compiled without problems with g++ v3.4.1
The new compiler complains that this macro takes two parameters. In fact, I found such line in standard strings.h:
#define index(s,c) strchr((s), (c))
So, I think the new compiler tries to call strchr() here instead of member variable initialization.
Does anybody know what old compiler did in this case? If it called strchr(), what did it use as a second parameter? Can this be the reason of stack corruption that we had with the code compiled with the old compiler?
If the old one properly initialized variable index, what was the reason for the new one to change its behavior?
Thanks a lot
 
Old 04-20-2011, 02:48 AM   #2
John VV
Guru
 
Registered: Aug 2005
Posts: 12,833

Rep: Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709
to many to post
Please READ the gcc web site
http://gcc.gnu.org/
example
the porting page for 4.1 to 4.3
http://gcc.gnu.org/gcc-4.3/porting_to.html
 
Old 04-20-2011, 06:07 PM   #3
dimaloma
LQ Newbie
 
Registered: Apr 2011
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by John VV View Post
to many to post
Please READ the gcc web site
http://gcc.gnu.org/
example
the porting page for 4.1 to 4.3
http://gcc.gnu.org/gcc-4.3/porting_to.html
I failed to find anything related to the relationship between macro and class member initialization for various GCC versions in this link.I still do not know whether old preprocessor applied macro to member init or not. Thanks, anyway.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the difference between gcc and g++ bskumar7080 Linux - Newbie 2 08-10-2009 08:20 AM
Small difference when compiled with gcc and g++ drigz Programming 5 06-15-2006 04:09 PM
any difference between gcc-c++ and gcc-g++ RajRed Linux - Software 5 12-03-2005 11:37 AM
what is the difference b/w these two? (gcc related) tuxfood Programming 1 07-20-2004 09:48 AM
what IS the difference between g++ and gcc? acid_kewpie Programming 5 12-08-2001 06:11 AM


All times are GMT -5. The time now is 04:46 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration