🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1091

Re: built-in strlen returns long unsigned int?

#1091
From: John Clark
Date: Tue, 08 Sep 1992 19:52
39 lines
1650 bytes
In article <1992Sep4.204457.25043@muddcs.claremont.edu> jason@jarthur.claremont.edu (Jason Merrill) writes:
+../../../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

Because ANSI C library definitions have:

size_t strlen( const char *);


+functions?  I haven't been able to find the place in the make process where
+this happens.

Look at the file 'sys-protos.h' in the gcc-2.2.2 directory.

+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(),


Appears to be non-ANSI standard string declarations. Get the book,
'The Standard C Library' by P.J. Plauger which describes the various
declarations for the ANSI library functions.
-- 

John Clark
jclark@ucsd.edu
Technical Details
Message-ID: <37814@sdcc12.ucsd.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sdcc3.ucsd.edu!jclark
References: <1992Sep4.204457.25043@muddcs.claremont.edu>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sdcc3.ucsd.edu!jclark
From: jclark@sdcc3.ucsd.edu (John Clark)
Subject: Re: built-in strlen returns long unsigned int?
Message-ID: <37814@sdcc12.ucsd.edu>
Sender: gnulists@ai.mit.edu
Organization: University of California, San Diego
References: <1992Sep4.204457.25043@muddcs.claremont.edu>
Distribution: gnu
Date: Tue, 8 Sep 1992 19:52:34 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 40