home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / gcc / bug / 2259 < prev    next >
Encoding:
Text File  |  1992-09-07  |  1.7 KB  |  66 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!jarthur.claremont.edu!jason
  3. From: jason@jarthur.claremont.edu (Jason Merrill)
  4. Subject: built-in strlen returns long unsigned int?
  5. Message-ID: <1992Sep4.204457.25043@muddcs.claremont.edu>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: Harvey Mudd College, Claremont, CA 91711
  8. Distribution: gnu
  9. Date: Fri, 4 Sep 1992 20:44:57 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 53
  12.  
  13. Compiling libg++ 2.2 with gcc 2.2.2, I get the following result:
  14.  
  15. -----
  16. gcc -g  -I.. -I../../../libg++/src -I../../../libg++/src/../iostream
  17. -I../../../libg++/src/../g++-include  -c ../../../libg++/src/AllocRing.cc 
  18.  
  19. In file included from ../../../libg++/src/std.h:26, from
  20. ../../../libg++/src/AllocRing.cc:22:
  21.  
  22. ../../../libg++/src/../g++-include/string.h:28: declaration of `int  strlen
  23. (const char *)'
  24.  
  25. <built-in>:0: conflicts with built-in declaration `long unsigned int
  26. strlen (const char *)'
  27. -----
  28.  
  29. Why does gcc think that strlen should return long unsigned int, rather than
  30. int?  How does it go about deciding the return type for these built-in
  31. functions?  I haven't been able to find the place in the make process where
  32. this happens.
  33.  
  34. I am working on a Sequent Symmetry running Dynix.  The string.h we are
  35. using comes, I believe, from the AT&T C++ translator v1.2, and looks like
  36. this:
  37.  
  38.  
  39. /*    @(#)string.h    1.2    */
  40. extern char
  41.     *strcpy(),
  42.     *strncpy(),
  43.     *strcat(),
  44.     *strncat(),
  45.     *strchr(),
  46.     *strrchr(),
  47.     *strpbrk(),
  48.     *strtok();
  49. extern int
  50.     strcmp(),
  51.     strncmp(),
  52.     strlen(),
  53.     strspn(),
  54.     strcspn();
  55.  
  56. Would the absence of "int" in front of "strlen()" be confusing the make
  57. process?  The strings.h on the machine is the Sequent version, and has the
  58. ususal-style declaration.
  59.  
  60. --
  61. Jason Merrill
  62. jason@jarthur.claremont.edu
  63. -- 
  64. Fool on a Pedestal
  65.  
  66.