delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2013/11/17/03:37:09

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
Message-ID: <52888021.6090401@iki.fi>
Date: Sun, 17 Nov 2013 10:36:49 +0200
From: Andris Pavenis <andris DOT pavenis AT iki DOT fi>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: ANNOUNCE: DJGPP port of GCC-4.8.2 (DJGPP v2.04 only)
References: <201310162005 DOT r9GK5npk027905 AT delorie DOT com> <52754597 DOT 9000204 AT iki DOT fi> <CAA-ihx-4pq4NNhHOGDvjWNN+LkSENK7cbTm9CdeopSy75x+kbA AT mail DOT gmail DOT com>
In-Reply-To: <CAA-ihx-4pq4NNhHOGDvjWNN+LkSENK7cbTm9CdeopSy75x+kbA@mail.gmail.com>
Reply-To: djgpp-workers AT delorie DOT com

On 11/17/2013 01:11 AM, Rugxulo wrote:
> Hi again,
>
> On Sat, Nov 2, 2013 at 1:33 PM, Andris Pavenis <andris DOT pavenis AT iki DOT fi> wrote:
>> On 10/16/2013 10:54 PM, Andris Pavenis wrote:
>>> This is announcement of DJGPP port of GCC-4.8.2
>> There are several problems with this port:
> On a completely separate (probably unimportant) note, I've got another
> concern about latest builds. I'm a little worried about broken
> functionality that isn't tested. In particular, this time I'm
> wondering if ObjC works at all (for us).
Played bit with several Objective-C Hello World programs. As I am
not familiar with this language either I did not have much more choice.

It seems that I have however identical behavior with native compiler
for Linux and DJGPP (for examples I succeeded to build at all)

For example (hello.h):
=============================
[andris AT ap objc]$ cat hello.m
#import <stdio.h>
#import <objc/Object.h>

@interface Hello: Object
- (void) say;
@end

@implementation Hello
- (void) say {
   printf("Hello, world!\n");
}
@end

int main() {
   Hello *hello = [Hello new];
   [hello say];
   [hello free];
   return 0;
}

[andris AT ap objc]$ i586-pc-msdosdjgpp-gcc -c -Wall -O0 -g hello.m
hello.m: In function 'main':
hello.m:15:3: warning: 'Hello' may not respond to '+new' [enabled by default]
    Hello *hello = [Hello new];
    ^
hello.m:15:3: warning: (Messages without a matching method signature [enabled by default]
hello.m:15:3: warning: will be assumed to return 'id' and accept [enabled by default]
hello.m:15:3: warning: '...' as arguments.) [enabled by default]
hello.m:17:3: warning: 'Hello' may not respond to '-free' [enabled by default]
    [hello free];
    ^

=============================
Compiled program crashes both under Linux (Fedora 19 x86_64, gcc-4.8.2) and
for DJGPP (gcc-4.8.2). For DJGPP I'm getting at first error message:
(class) Hello does not recognize new
Abort!

It compiles however without warnings and works in CentOS 6.4 x86_64
(RHEL 6.4 clone) compiled with gcc-4.4.7 (RedHat version not FSF one)

Found another simpler example (taken from internet with small modifications
after that)
=============================
[andris AT ap objc]$ cat hello2.m
#import <stdio.h>

int main (void)
{
     printf ("Hello world!\n");
     return 0;
}
=============================
It compiles and works for both Linux (same distribution) and DJGPP

So this problem seems to be generic GCC one but not specially DJGPP one.

Andris

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019