www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/15/22:56:22

From: nikki AT gameboutique DOT co (nikki)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Forgive my ignorance, but can someone answer a question for me?
Date: 16 Feb 1997 01:34:01 GMT
Organization: GameBoutique Ltd.
Lines: 55
Message-ID: <5e5o69$g5b@flex.uunet.pipex.com>
References: <5e5kn5$n1d$1 AT scoop DOT suba DOT com>
NNTP-Posting-Host: www.gameboutique.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

[Posted and mailed]

> I'm under the impression that djgpp is a gcc compiler for DOS,
> correct?

a port of gcc for dos yep.

> Assuming I am, gcc is suppost to be a cross-platform compiler, and the
> coding for gcc applications isn't suppost to use any hardware-specific
> instructions, correct?

well, ansi c isn't supposed to use hardware specific instructions. but you're
allowed to use them under many compilers using extended syntaxes.

> If I am correct so far, wouldn't that mean that gcc applications
> written for Unix systems could be compiled under DOS using djgpp? 

yep, i'm doing just that at the moment :)

> If so, what is the extent?  Could I compile X Windows under DOS, for
> instance?  I am not a programmer, or a techie, so I know I'm kind of

well.. you'd be very unlikely to get that to compile :) if you want x for
a pc use xfree86 under linux of course...

the extent is basically, everything compiles fine except:

1) have to remember that byte order is reversed on some platforms.
2) have to remember that djgpp doesn't zero malloc'd blocks which sunos does.
3) don't appear to be able to cast values which would be cast anyway.
4) another weirdity which is preventing my code from running atm and which
i'm hoping someone will spot the problem with :) (re: boo hoo my code crashes)

> ignorant about all of this, but if anyone could help me out on
> cross-compatibility between gcc applications under Unix being compiled
> under djgpp for DOS, please let me know..

it's really very good, memory management on the pc sucks and djgpp has a very
neat way of getting round all this, you can do everything you could under
any other compiler on the pc, plus copy all the unix stuff over and just 
type 'make' or gcc <file> and that will all work too.
but if the code wasn't 'well written' in the first place little problems
like the malloc one i mentioned make porting a real pain :(

> (Email if possible, thanks!)

emailed too.

regards,
nik


-- 
Graham Tootell           
nikki AT gameboutique DOT com  

- Raw text -


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