🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #49968

size_t incorrectly set in _G_config.h for gcc 2.5.5, SunOS 4.1.2??

#49968
From: Douglas Scott
Date: Wed, 01 Dec 1993 20:04
49 lines
2698 bytes
System:  Sun Sparc, SunOS 4.1.2
Compiler:  gcc/g++ 2.5.5

This is the compiler error that alerted me:

g++ -O2 -g  -pipe -Wall -Wno-unused -Wno-import  -DNDEBUG -DUSE_CUSTOM_NEW   
-Dcplusplus_2_1 -Div2_6_compatible  -I.. -I/usr/local/src/adc -I/usr/demo/SOUND  
-I/usr/local/InterViews3.1/include/IV-2_6 -I/usr/local/InterViews3.1/include    
-pipe -c ../opener.C
In file included from ../opener.C:16:
/usr/include/strings.h:18: warning: declaration of `int strlen(...)'
/usr/include/strings.h:18: warning: conflicts with built-in declaration `long  
unsigned int strlen(const char *)'
In file included from /usr/local/lib/g++-include/std.h:26,
                 from /usr/local/lib/g++-include/builtin.h:32,
                 from ../localdefs.h:24,
                 from ../opener.C:25:
/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.2/2.5.5/include/string.h:31:  
conflicting types for `long unsigned int strlen(const char *)'
/usr/include/strings.h:18: previous declaration as `int strlen(...)'

Here is the declaration of strlen in
/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.2/2.5.5/include/string.h:

extern size_t   strlen _PARAMS((const char *));

Here it is in /usr/include/string.h:

extern size_t   strlen(/* const char *s */);

Looks good, except for the fact the size_t is defined on the Sparc as follows:

/usr/include/sys/stdtypes.h:typedef     int             size_t;         /* ???  
*/

but in _G_config.h:

/usr/include/g++/_G_config.h:typedef long unsigned int _G_size_t;


I am not sure why this problem only showed up for the declaration of strlen(),  
and not for any other functions which use the size_t type.  Perhaps this  
relates to my inclusion of <strings.h> instead of <string.h>?

---
Douglas Scott             |             Senior Development Engineer
Tel: (805) 893-8352       | Center for Computer Music Research and Composition
Internet (NeXTMail ok):   |                  Music Department
<doug@ccmrc.ucsb.edu>     |       University of California, Santa Barbara
Technical Details
Message-ID: <9312011959.AA28375@foxtrot.ccmrc.ucsb.edu>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!foxtrot.ccmrc.ucsb.edu!doug

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,44ff698003b6ef32,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-12-01 12:41:04 PST
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!foxtrot.ccmrc.ucsb.edu!doug
From: doug@foxtrot.ccmrc.ucsb.edu (Douglas Scott)
Newsgroups: gnu.gcc.help
Subject: size_t incorrectly set in _G_config.h for gcc 2.5.5, SunOS 4.1.2??
Date: 1 Dec 1993 15:04:50 -0500
Organization: GNUs Not Usenet
Lines: 49
Sender: daemon@cis.ohio-state.edu
Distribution: gnu
Message-ID: <9312011959.AA28375@foxtrot.ccmrc.ucsb.edu>