This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: FreeBSD Fortran Failure
- To: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- Subject: Re: FreeBSD Fortran Failure
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Tue, 15 May 2001 22:03:33 +0200
- CC: gcc-bugs at gcc dot gnu dot org, mark at codesourcery dot com
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <200105150205.f4F25dc08765@latour.rsch.comm.mot.com>
Loren James Rittle wrote:
> Here is my statement and analysis of the problem.
>
> The problem is that no prototype for ftruncate() is seen in scope
> while the code in libf2c/libI77/endfile.c is compiled.
[ Because _POSIX_SOURCE is defined while including unistd.h ]
> S rittle@latour; ccvs diff -c endfile.c
> Index: endfile.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/libf2c/libI77/endfile.c,v
> retrieving revision 1.5
> diff -c -r1.5 endfile.c
> *** endfile.c 2001/02/26 20:23:41 1.5
> --- endfile.c 2001/05/15 01:42:39
> ***************
> *** 1,7 ****
> --- 1,9 ----
> #include "f2c.h"
> #include "fio.h"
>
> + #undef _POSIX_SOURCE
> #include <unistd.h>
> + #define _POSIX_SOURCE 1
>
> #ifdef KR_headers
> extern char *strcpy();
Hmmm, I have the odd feeling that this won't be accepted as a solution
:-)
However, if you look back at the patch that went in on the 27th of
February, you'll see that the inclusion of unistd.h was specifically
added to get a prototype of ftruncate *and for no other reason*.
Would it be a solution to "agree" on a prototype and add *that* instead
of the unistd.h include ? Or would that evoke other problems ?
Mark ?
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)