www.delorie.com/djgpp/bugs/show.cgi   search  
Bug 000309

When Created: 12/28/1999 14:00:49
Against DJGPP version: 2.01
By whom: gandalf_Gray@hotmail.com
Abstract: Exe's made with gcc work wrong when the sourcecode is in several files
When I write even the simplest program where a function
isn't in the same file as void main(), the function behaves
oddly. Observe:

(main.c)

void main()
{
 test(3.14);
}

(func.c)

void test(float x)
{
 printf("%f", x);
}

This produces a VERY strange result (something like
2412414111790870452845312.00001239864). But when
the function is in the same file as main(), it all
runs nicely.

(For some weird reason, the above function DID
work in a separate file, when I exchanged "float x"
for "double x").

I would appriciate all input.

//Bartek Tatkowski A.K.A. archaos

Note added: 12/29/1999 11:00:12
By whom: eliz@is.elta.co.il
This is a cockpit error: the function test() doesn't have
a prototype visible when main() is compiled, so the compiler
produces incorrect code.

I'm closing this report.

Closed on 12/29/1999 11:00:19: User error, not a bug.
By whom: eliz@is.elta.co.il



  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2010   by DJ Delorie     Updated Jul 2010