www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/01/15:03:54

Sender: nate AT cartsys DOT com
Message-ID: <35C3512B.69A46761@cartsys.com>
Date: Sat, 01 Aug 1998 10:32:27 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
MIME-Version: 1.0
To: "Jorge Iván Meza Martínez" <jimeza AT usa DOT net>
CC: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT gov DOT ar>, djgpp AT delorie DOT com
Subject: Re: problems with RHIDE under Windows98
References: <005601bdbc09$7d5b39a0$1b1f1bc4 AT enterprise-z>

Jorge Iván Meza Martínez wrote:
> 
> >Is not clear: if your application returns 255 then is compiled, but you say
> >"...when I try to compile...". What's the real thing?
> >I guess you can compile and is  when you run the program.
> >s the same if you run the program from DOS?
> 
> yip, I could compile the program and linked and I got an .exe but it always
> crashed with 255 and if I run a couple of times more crashed my DOS session
> too.
> 
> but the problem was a call of a function ( of my own ) with out prototype,
> the compiler didn't warned me; I got the same problem when I forgot put
> "void" before a process name ( I just wrote process_name ( params ) ), the
> compiler said that all was OK with the code.
> 
> I fixed it and all worked fine; but I think that it is an strange behavior
> for this kind of errors;
> I think that the compiler should catch this kind of code mistakes.

If you enable more warnings (-Wall from the command line, not sure how
from RHIDE but I know you can), it will.

Declaring/defining a function without giving a return type is legal; it
defaults to `int'.  This used to be very common practice in old code,
since original K&R C did not have the `void' keyword.  Thus, if a
function had no reason to return anything useful, you would omit the
`int' to emphasize that, and either let it fall off the end without a
`return', or have a return without a value (which is also legal).  This
would leave the return value undefined (i.e. whatever happened to be in
the appropriate register), but as long as you never used it, you'd be
fine.
-- 

Nate Eldredge
nate AT cartsys DOT com


- Raw text -


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