forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ee-gcc and __LONG_MAX__

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
spambait



Joined: 17 Apr 2005
Posts: 6

PostPosted: Sun Apr 17, 2005 9:06 pm    Post subject: ee-gcc and __LONG_MAX__ Reply with quote

The current toolchain from CVS seems to create an ee-gcc which has a wrong __LONG_MAX__ definition, therby breaking <limits.h> and possibly other things.

Please fix by updating the (builtin?) specs. Thanks.
Back to top
View user's profile Send private message
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Sun Apr 17, 2005 9:22 pm    Post subject: Reply with quote

printf("%X", __LONG_MAX__);

7FFFFFFFFFFFFFFF


which is perfectly correct.
_________________
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Back to top
View user's profile Send private message
spambait



Joined: 17 Apr 2005
Posts: 6

PostPosted: Sun Apr 17, 2005 9:55 pm    Post subject: Reply with quote

Which compiler flags are you using ? Actually it seems __LONG_MAX__ is not defined at all (see *long_max_spec in ee/lib/gcc-lib/ee/3.2.2/specs).


Code:

> cat x.c
#ifndef __LONG_MAX__
#error "1"
#endif
#include <limits.h>
#ifndef __LONG_MAX__
#error "2"
#endif
#if __LONG_MAX__ != 9223372036854775807L
#error "3"
#endif

> /opt/cc-i386-linux/cross/ps2/mips64el-ps2.ps2dev-20050412/ee/bin/ee-gcc -v
Reading specs from /opt/cc-i386-linux/cross/ps2/mips64el-ps2.ps2dev-20050412/ee/lib/gcc-lib/ee/3.2.2/specs
Configured with: ../configure --prefix=/opt/cc-i386-linux/cross/ps2/mips64el-ps2.ps2dev-20050412/ee --target=ee --enable-languages=c,c++ --with-newlib --with-headers=/opt/cc-i386-linux/cross/ps2/mips64el-ps2.ps2dev-20050412/ee/ee/include --enable-cxx-flags=-G0
Thread model: single
gcc version 3.2.2

> /opt/cc-i386-linux/cross/ps2/mips64el-ps2.ps2dev-20050412/ee/bin/ee-gcc -c x.c
x.c:2:2: #error "1"
x.c:9:2: #error "3"
Back to top
View user's profile Send private message
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Sun Apr 17, 2005 10:18 pm    Post subject: Reply with quote

ee-gcc -D__LONG_MAX__=9223372036854775807L of course.

Seriously: update your toolchain (both gcc and ps2sdk) using cvs sources.
_________________
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Back to top
View user's profile Send private message
spambait



Joined: 17 Apr 2005
Posts: 6

PostPosted: Sun Apr 17, 2005 10:30 pm    Post subject: Reply with quote

My toolchain is from 20050412, which includes the latest CVS ps2toolchain/gcc-3.2.2.patch from Apr 09. Is there any newer version ?
Back to top
View user's profile Send private message
spambait



Joined: 17 Apr 2005
Posts: 6

PostPosted: Sun Apr 17, 2005 10:57 pm    Post subject: Reply with quote

Ok, I've just seen your glimits.h update to gcc-3.2.2 CVS, and while I'm not sure what you mean with "command line setup" in your CVS comment I still think that the specs should be fixed. Anyway, many thanks.
Back to top
View user's profile Send private message
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Sun Apr 17, 2005 11:33 pm    Post subject: Reply with quote

The right command line would be -isystem $PS2SDK/common/include
_________________
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Back to top
View user's profile Send private message
cory1492



Joined: 10 Dec 2004
Posts: 216

PostPosted: Sun Apr 17, 2005 11:44 pm    Post subject: Reply with quote

Quote:
Ho well, let's have that into the toolchain as well, so that people who REALLY do not know how to set up command line options will be happy.

You werent talking about me were you? LOL thanks pixel!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group