Mail Archives: djgpp/1997/07/05/13:03:14
Dan wrote:
>
> I'm having a problem compiling in DJGPP - I wonder if anyone has seen
> the same thing.
>
> Basically, on compilation, the syntax checker does not notice mis-typed
> library function calls, for example 'helloworld()' instead of
> 'hello_world()'. I can then compile and link the program, which then
> obviously crashes on execution, due to a call to the non-existent
> 'helloworld()' function.
This is not a problem with the compilation; it's the way gcc (and most C
compilers AFAIK) handle undeclared functions. If you call a function
named 'helloworld()' in your code, the compiler assumes that this symbol
will become defined at some point in the future and doesn't worry about
it, trusting the linker to catch any problems and stop with an error.
(If you compile with '-Wall' you'll be warned about implicit function
declarations.)
That the linker does not stop indicates that you have replaced the
default linker with another; possibly the one from RSXDJ131. This
linker theoretically has been modified so as not to give errors for
undefined references. Somebody posted a solution of sorts to the
problem a while back... I think.
--
---------------------------------------------------------------------
| John M. Aldrich | "A generation which ignores history |
| aka Fighteer I | has no past--and no future." |
| mailto:fighteer AT cs DOT com | |
| http://www.cs.com/fighteer | - Lazarus Long |
---------------------------------------------------------------------
- Raw text -