home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / gcc / bug / 2801 < prev    next >
Encoding:
Text File  |  1992-11-20  |  1.9 KB  |  52 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!cs.utexas.edu!singhal
  3. From: singhal@cs.utexas.edu (Vivek Singhal)
  4. Subject: GCC 2.3.1 on Sparc -- conflicting types
  5. Message-ID: <9211201604.AA14005@twins.cs.utexas.edu>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Fri, 20 Nov 1992 04:04:04 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 39
  12.  
  13. Here's a bug I ran across when compiling glibc-1.05 on a Sparc running
  14. SunOS 4.1.2 (using GCC 2.3.1).  GCC reports an extraneous error
  15. (conflicting types for `puts'); note that this error disappears when
  16. the declaration for `strlen' is removed.
  17.  
  18. This error does not occur on other architectures that I've tried
  19. (DecStation 5000/20 running Ultrix 4.2a, HP 9000/300 running HP/UX
  20. 7.0, Sun 3/50 running SunOS 4.1.2).
  21.  
  22. Vivek
  23.  
  24. ----------------------------------------------------------------
  25. Vivek Singhal      singhal@cs.utexas.edu  Office: (512) 471-9711
  26. Univ of TX @ Austin, CS Dept, TAY 3.104C    Home: (512) 385-1855
  27.  
  28. % cat puts-bug.c 
  29. typedef unsigned long int size_t;
  30. typedef struct stdio_file FILE;
  31. extern FILE *stdout;
  32. extern int putchar (int c);
  33. extern int fputs (const char *s, FILE * stream);
  34. extern int puts (const char *s);
  35. extern size_t strlen (const char *s);
  36.  
  37. int
  38. puts (const char *s)
  39. {
  40.   return (fputs (s, stdout) || putchar ('\n') == (-1) ? (-1) : 0);
  41. }
  42. % gcc -v -c puts-bug.c
  43. Reading specs from /p/lib/gcc-lib/sun4/2.3.1/specs
  44. gcc version 2.3.1
  45.  /p/lib/gcc-lib/sun4/2.3.1/cpp -lang-c -v -undef -D__GNUC__=2 -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix puts-bug.c /usr/tmp/cca23212.i
  46. GNU CPP version 2.3.1 (sparc)
  47.  /p/lib/gcc-lib/sun4/2.3.1/cc1 /usr/tmp/cca23212.i -quiet -dumpbase puts-bug.c -version -o /usr/tmp/cca23212.s
  48. GNU C version 2.3.1 (sparc) compiled by GNU C version 2.3.1.
  49. puts-bug.c:11: conflicting types for `puts'
  50. puts-bug.c:6: previous declaration of `puts'
  51.  
  52.