discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Creating a GNUstep desktop on Solaris


From: Andreas Höschler
Subject: Re: Creating a GNUstep desktop on Solaris
Date: Thu, 6 Jan 2005 17:35:18 +0100

Hi Adam,

I'm rather new to Objective-C and Cocoa/GNUStep programming, but is this the standard behavior?

I thought, that messages sent to nil objects should be silently ignored by the Objective-C runtime system. Am I missing something?


Yes it is standard behavior, and ObjC does ignore a message to a nil object and just returns 'NULL'. The problem is Solaris chokes when you try to assign a 'NULL' to a structure. Even this should crash Solaris (if you could actually compile it, which you can't since the compiler is smart enough for this):

struct foo {int i; int j;};

struct foo bar;

bar = (struct foo)0;

Haven't tried to compile this example on the Solaris yet, however I would consider the above code to be illegal, whether this works on some platforms or not. Assign Null to a structure simply makes no sence. I would expect that the compiler, or if it goes through the runtime does not know how to handle this.

It sounds like you mean mean that TextEdit.app and also GNUMail.app do crash on Solaris because of this problem. Well, I successfully compiled both on Solaris. So the compiler is not preventing the problem by refusing to compile the code.

IMHO this should be fixed in the TextEdit.app and GNUMail.app sources and coders should make sure to always check a pointer for NULL before assigning it to a struc, shouldn't they?

Regards,

   Andreas




reply via email to

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