help-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

strange behaviour of GSPrintf


From: Sebastian Reitenbach
Subject: strange behaviour of GSPrintf
Date: Sun, 17 Sep 2006 16:49:57 -0000

Hi,

I observed that when I compile the piece of code at the end
gmake debug=yes

then I get the following output:

$ obj/ArrayTest
2006-09-17 21:34:54.322 ArrayTest[31262] Msg3
2006-09-17 21:34:54.323 ArrayTest[31262] Msg4
Msg2$

when I change the line 
  GSPrintf(stdout, @"%@", [outArray objectAtIndex: 1]);
to 
  GSPrintf(stdout, @"%@\n", [outArray objectAtIndex: 1]);

I get the following output:

$ obj/ArrayTest
Msg2
2006-09-17 21:36:38.694 ArrayTest[28187] Msg3
2006-09-17 21:36:38.695 ArrayTest[28187] Msg4
$                                                

is that explainable somehow? I compiled the sources from svn with gcc 3.3.5 
and ffcall 1.9 on an actual OpenBSD snapshot.

kind regards
Sebastian




#include "Foundation/Foundation.h"

int main(void)
{
  NSArray               *outArray;
  NSAutoreleasePool     *pool;

  pool = [NSAutoreleasePool new];
  outArray = [NSArray arrayWithObjects: @"Msg1", @"Msg2", @"Msg3", @"Msg4", 
nil];

//  printf("%s\n", (char *) [outArray objectAtIndex: 0]);

  GSPrintf(stdout, @"%@", [outArray objectAtIndex: 1]);

  NSLog(@"%@", [outArray objectAtIndex: 2]);

#ifdef DEBUG
  NSLog(@"%@", [outArray objectAtIndex: 3]);
#endif

  RELEASE(pool);
  return EXIT_SUCCESS;
}






reply via email to

[Prev in Thread] Current Thread [Next in Thread]