Mail Archives: djgpp-workers/2013/11/17/03:37:09
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 -