Bug report -- gcc-2.95

Mark Schoenberg mark@lpb.niams.nih.gov
Tue Nov 2 18:49:00 GMT 1999


     Mumit Khan's port of gcc-2.95 for Cygwin failed to compile the following
simple subroutine with the command "gcc -v -O2 -mno-cygwin -c mdate.c -o
mdate.o".

#include <sys/time.h>
char *mdate()
{

  time_t ts;
  char *ntime, *ctime(), buf[100];
  int ni;

  time(&ts);
  ntime = ctime(&ts);
  strcpy(buf,ntime);
  ni= strlen(buf);
  buf[ni-1] = '\0';
  strcpy(ntime,buf);
  return (ntime);
}

Output from the compile is as follows:

Reading specs from /cygnus/gcc-2.95/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/2.95/specs
gcc version 2.95 19990728 (release)
 /cygnus/gcc-2.95/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/2.95/cpp.exe -lang-c -v -iprefix /cygnus/gcc-2.95/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/2.95/ -D__GNUC__=2 -D__GNUC_MINOR__=95 -Di386 -D_WIN32 -DWINNT -D_X86_=1 -D__STDC__=1 -D__stdcall=__attribute__((__stdcall__)) -D__cdecl=__attribute__((__cdecl__)) -D__declspec(x)=__attribute__((x)) -D__i386__ -D_WIN32 -D__WINNT__ -D_X86_=1 -D__STDC__=1 -D__stdcall=__attribute__((__stdcall__)) -D__cdecl=__attribute__((__cdecl__)) -D__declspec(x)=__attribute__((x)) -D__i386 -D__WINNT -Asystem(winnt) -Acpu(i386) -Amachine(i386) -remap -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di586 -Dpentium -D__i586 -D__i586__ -D__pentium -D__pentium__ -iwithprefixbefore ../../../../i586-cygwin32/include/mingw32 -D__MINGW32__=0.2 mdate.c c:\windows\TEMP/ccFtaaaa.i
GNU CPP version 2.95 19990728 (release) (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
 /cygnus/gcc-2.95/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/2.95/../../../../../include
 /cygnus/gcc-2.95/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/2.95/../../../../i586-cygwin32/include
 /cygnus/gcc-2.95/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/2.95/include
 /Cygnus/cygwin-b20/H-i586-cygwin32/lib/gcc-lib/i586-cygwin32/2.95/../../../../../include
 /Cygnus/cygwin-b20/H-i586-cygwin32/lib/gcc-lib/i586-cygwin32/2.95/../../../../i586-cygwin32/include
End of search list.
The following default directories have been omitted from the search path:
 /Cygnus/cygwin-b20/H-i586-cygwin32/lib/gcc-lib/i586-cygwin32/2.95/../../../../../include/g++-3
 /usr/include
End of omitted list.
 /cygnus/gcc-2.95/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/2.95/cc1.exe c:\windows\TEMP/ccFtaaaa.i -quiet -dumpbase mdate.c -mno-cygwin -version -o c:\windows\TEMP/ccaNaaaa.s
GNU C version 2.95 19990728 (release) (i586-cygwin32) compiled by GNU C version 2.95 19990728 (release).
mdate.c: In function `mdate':
mdate.c:5: `time_t' undeclared (first use in this function)
mdate.c:5: (Each undeclared identifier is reported only once
mdate.c:5: for each function it appears in.)
mdate.c:5: parse error before `ts'
mdate.c:9: `ts' undeclared (first use in this function)

     I am running the standard full version of Cygwin-b20.1 under Windows98 on
my HP Pavilion PC.  Cygwin-b20.1 gcc compiles the above without complaint.
Both Cygwin-b20.1 and Khan's port compile the above if the "-mno-cygwin"
parameter is omitted.  Also, gcc-2.95 compiles the above, without -mno-cygwin
obviously, under HP-UX 10.20 on a HP workstation.


Mark Schoenberg
emmes@starpower.net

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list