From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19447 invoked by alias); 17 Mar 2008 16:05:51 -0000 Received: (qmail 19417 invoked by uid 22791); 17 Mar 2008 16:05:47 -0000 X-Spam-Check-By: sourceware.org Received: from root1.de (HELO mx.root1.de) (213.239.206.135) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 17 Mar 2008 16:05:22 +0000 Received: from localhost (root1.local [127.0.0.1]) by mx.root1.de (Postfix) with ESMTP id 1E7F6488B1C; Mon, 17 Mar 2008 17:05:08 +0100 (CET) X-Spam-Score: 1.753 Received: from mx.root1.de ([127.0.0.1]) by localhost (root1.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r2ZvhqgsVYnA; Mon, 17 Mar 2008 17:05:00 +0100 (CET) Received: from [192.168.0.244] (p5B215A7E.dip.t-dialin.net [91.33.90.126]) by mx.root1.de (Postfix) with ESMTP id 217B5488B14; Mon, 17 Mar 2008 17:05:00 +0100 (CET) Message-ID: <47DE96AB.7000108@root1.de> Date: Mon, 17 Mar 2008 16:05:00 -0000 From: Alexander Christian User-Agent: Thunderbird 2.0.0.12 (X11/20080226) MIME-Version: 1.0 To: John Love-Jensen Cc: GCC-help Subject: Re: Strange syntax error problem with mmorpg-framework References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg00162.txt.bz2 John Love-Jensen wrote: > Hi Alex, > > The problem is probably in the expansion of the macros. > > From the macros visible in the trunk/src/game/Player.cpp [5122:5445] diff, > it is not apparent what the problem is, since not all macros involved are > available in that diff. > The player.cpp source is directly available via http://www.mangosproject.org/trac/browser/trunk/src/game/Player.cpp?rev=5126&format=raw , if you find time to have a look at it ... > It appears that someone tried to make accessing the "value index" more > regular, by introducing a PLAYER_SKILL_VALUE_INDEX macro function. Perhaps > a glitch was introduced as well. > I opened player.cpp and search for "PLAYER_SKILL_VALUE_INDEX". I found the following at the beginning (nearly) of the file: ----code---- #define PLAYER_SKILL_VALUE_INDEX(x) (PLAYER_SKILL_INDEX(x)+1) ----/code---- Looks like the macro you mentioned?! The "funny" thing is: This error's doesn't appear on all user's machines. There are many users out there who don't have this problems. So the errors aren't a real blocker. And that's why I'm so confused. The devs say, that gcc 4.x.y should work fine and don't have this problems. Is it possible that a library that gcc uses is not up2date for using those macros? > In general, for C++, I strongly recommend avoiding macro functions and macro > constants. Instead, use the C++ facilities of inline functions and const > identifiers. > > There are a few exceptions to my C++ rule-of-thumb, such as assert macro > functions. But the exceptions to the rule are very few. > > My advice is probably too late for the developers to adopt. Alas. > I will post this to the devs... Maybe it's not "too late" ;-) > You may be able to identify the problem if you compile that .cpp file with > the g++ -E switch, and look at the post-preprocessed output. > > Sincerely, > --Eljay > > I will have to look at the created makefile to enable this switch ... so far, thanks for your help. br, Alex