In message <[email protected]>
          Ron <[email protected]> wrote:

> In message <[email protected]> you wrote:
> 
> > 
> > Hi Ron,
> > 
> > > unix.c: In function 'maketmp':
> > > unix.c:297: warning: implicit declaration of function 'mkstemp'
> > 
> > This is saying a call to mkstemp() is occurring without a function
> > prototype being seen that declares its arguments and return type;  an
> > implicit declaration rather than explicit is being used.
> > 
> > The prototype for mkstemp() can be found by `#include <stdlib.h>'.
> > 
> > Cheers,
> > Ralph.
> > 
> Thanks for the reply to my first posting Ralph, a bit in the dark.
> I thought the Unixlib libs were included by default when you run
> gcc?

Yes, UnixLib library is automatically added when linking (unless you're
using SharedCLibrary of course).  But that does not mean its headers
are automatically included when compiling.

> Anyway, I tried #include <stdlib.h> and it still gets the error.
> I think the name mkstemp sounds like it is a mk variable.
> I entered a declaration 'int mkstemp();' below the 'int fd:'
> and it satisfied the compiler, (no warning) but I am unsure
> how correct this is and it hasn't changed the behavior of mk.

Actually you're highlighting an UnixLib bug here.  It is supposed to
be prototyped in stdlib.h but is actually wrongly done in stdio.h.  I'll
fix that for the next release.

In the meanwhile, a cleaner and temporary solution is to add
'#include <stdio.h>' instead of your own prototype.

John.
-- 
John Tytgat, in his comfy chair at home                                 BASS
[email protected]                             ARM powered, RISC OS driven

_______________________________________________
GCCSDK mailing list [email protected]
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

Reply via email to