🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1065

built-in strlen returns long unsigned int?

#1065
From: Jason Merrill
Date: Fri, 04 Sep 1992 20:44
52 lines
1835 bytes
Compiling libg++ 2.2 with gcc 2.2.2, I get the following result:

-----
gcc -g  -I.. -I../../../libg++/src -I../../../libg++/src/../iostream
-I../../../libg++/src/../g++-include  -c ../../../libg++/src/AllocRing.cc 

In file included from ../../../libg++/src/std.h:26, from
../../../libg++/src/AllocRing.cc:22:

../../../libg++/src/../g++-include/string.h:28: declaration of `int  strlen
(const char *)'

<built-in>:0: conflicts with built-in declaration `long unsigned int
strlen (const char *)'
-----

Why does gcc think that strlen should return long unsigned int, rather than
int?  How does it go about deciding the return type for these built-in
functions?  I haven't been able to find the place in the make process where
this happens.

I am working on a Sequent Symmetry running Dynix.  The string.h we are
using comes, I believe, from the AT&T C++ translator v1.2, and looks like
this:


/*	@(#)string.h	1.2	*/
extern char
	*strcpy(),
	*strncpy(),
	*strcat(),
	*strncat(),
	*strchr(),
	*strrchr(),
	*strpbrk(),
	*strtok();
extern int
	strcmp(),
	strncmp(),
	strlen(),
	strspn(),
	strcspn();

Would the absence of "int" in front of "strlen()" be confusing the make
process?  The strings.h on the machine is the Sequent version, and has the
ususal-style declaration.

--
Jason Merrill
jason@jarthur.claremont.edu
-- 
Fool on a Pedestal
Technical Details
Message-ID: <1992Sep4.204457.25043@muddcs.claremont.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!jarthur.claremont.edu!jason

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!jarthur.claremont.edu!jason
From: jason@jarthur.claremont.edu (Jason Merrill)
Subject: built-in strlen returns long unsigned int?
Message-ID: <1992Sep4.204457.25043@muddcs.claremont.edu>
Sender: gnulists@ai.mit.edu
Organization: Harvey Mudd College, Claremont, CA 91711
Distribution: gnu
Date: Fri, 4 Sep 1992 20:44:57 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 53