bugGNUstep - Bugs: bug #4711, Problem handling/formating long...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #4711: Problem handling/formating long long numbers

Submitted by:  Manuel Guesdon <mguesdon>
Submitted on:  Mon 11 Aug 2003 06:02:08 PM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Works For Me
Privacy: PublicAssigned to: None
Open/Closed: Closed

Fri 28 Nov 2003 06:52:50 PM UTC, comment #4:

This functionality works as expected.

Manuel Guesdon <mguesdon>
Project Member
Fri 29 Aug 2003 03:26:39 AM UTC, comment #3:

Looks like gcc doesn't define _OBJC_ when compiling an Objective-C file if it's using the c99 or gnu99 standard. Probably a compiler bug?

Adam Fedor <fedor>
Project Administrator
Sat 23 Aug 2003 10:55:23 AM UTC, comment #2:

I investigated deeper and found that the problem seems to be not in GSFormat.
configure doesn't define HANDLE_LONG_LONG_MAX because LLONG_MAX is not defined.
LLONG_MAX is defined in limits.h if some compilation directives are defined. And in my case, it is not defined.
By using export CPPSFLAGS=gnu99 or CPPSFLAGS=c99, LLONG_MAX is defined so HANDLE_LONG_LONG_MAX is defined but now core/base no more compile (Protol definition conflict between NSObject.h and /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.2.2/include/objc/objc.h)

Any idea ?

Manuel Guesdon <mguesdon>
Project Member
Mon 11 Aug 2003 06:18:22 PM UTC, comment #1:

Problem seems to come from GSFormat wich seems to not handle double length modifier like hh, ll

There's also a documentation problem in NSNumber.m:
<term> long long</term>
<desc>%li</desc>
is the same as for long (it should be %lli instead of %li).

idem for unsigned long long

Manuel Guesdon <mguesdon>
Project Member
Mon 11 Aug 2003 06:02:08 PM UTC, original submission:

Jus try this:

NSNumber* testNumber=[NSNumber numberWithLongLong:3372036854775807LL];

NSDebugMLog(@"testNumber=%@",testNumber);
==> -2098855937 (Bad)

NSDebugMLog(@"[testNumber longLongValue]=%lld",[testNumber
longLongValue]);
==> -2098855937 (Bad)

fprintf(stdour,"[value longLongValue]=%lld\n",[value longLongValue]);
==> 3372036854775807 (Good)

Manuel Guesdon <mguesdon>
Project Member

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 5 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sun 22 May 2005 11:21:19 PM UTCFredKieferOpen/ClosedDeclined=>Closed
Fri 28 Nov 2003 06:52:50 PM UTCmguesdonStatusNone=>Works For Me
  Open/ClosedOpen=>Declined
Sat 23 Aug 2003 10:55:23 AM UTCmguesdonItem GroupNone=>(Error - Not Found)
Sat 23 Aug 2003 10:55:22 AM UTCmguesdonSeverity4 - Important=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1