Article View: comp.windows.interviews
Article #1683Re: Problem with GCC-2.4.5, and libg++-2.4 compiling IV-3.1...
From: Steve Wu
Date: Wed, 14 Jul 1993 22:11
Date: Wed, 14 Jul 1993 22:11
72 lines
3441 bytes
3441 bytes
aad@scr.siemens.com (Anthony A. Datri) writes:
>>>Like I just said, IT DOESN'T. In fact, String.cc contains
>>>Now, it's difficult to know if this is ever actually used as strlen, but
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> It does. libg++-2.4 fixes the problem
>One more time. I ************AM************** using 2.4.
>. slen is not strlen, strlen is
>>a Sun libc call and slen is only a inline used in String.cc.
> <=>lovecraft<=>uname -a
> SunOS lovecraft 4.1.3 1 sun4c
> <=>lovecraft<=>grep strlen /usr/include/string.h
> extern size_t strlen(/* const char *s */);
> <=>lovecraft<=>grep size_t /usr/include/sys/stdtypes.h
> * define the thingy. This is used so that we don't have size_t in
> typedef int size_t; /* ??? */
>The libc call is an int. I N T.
>> The problem you mentioned about gcc and interview is becuase you
>>have the wrong libg++. I also encountered this problem which was
>>caused by gcc-2.3.3 compiled libg++-2.4.
>I don't know what kind of number system you use, but in mine 2.4 = 2.4.
OK let clear some misunderstanding:
try this:
vi test.c
#include <stdio.h>
typedef float size_t;
main()
{
size_t a = strlen("You missed");
int b = strlen("You missed");
short c = strlen("You missed");
printf("You missed %f %d %d %d\n", a, (unsigned long)a, b, c);
}
and cc test.c, gcc test.c
what you get is: NO complain at all. compiler doesn't care whether
size_t is a long, float or anything, as long as there is no
prototyping.
In
/usr/dist/gnu/lib/gcc-lib/sparc-sun-sunos4.1.3/2.4.5/include/string.h,
it prototype strlen as size_t, and if you have that include and have
int a = strlen(...) then you will have problem. If the header files
you have are not the gcc 2.4.5, you have a different typedef. Also,
there was a inconsistant using of size_t in libg++ which has been
fixed. I have install gcc-2.4.5, libg++-2.4 and IV 3.1 on
sparc-sun-sunos4.1.3 and I don't have to modified SIZE_TYPE (as what
the src said "In 2.4 it should work to delete it". Anyway, you must
have done something wrong.
Also, gcc's notation should be right, strlen should be unsigned int,
what would it mean by a minus string lenght?
steve
--
stevew@helios.unl.edu |=| \ Fender / |=| ... smoke on the water, fire in
|=| \ / |=| the sky... Smoke on the water.
stevew@hoss.unl.edu |=| \/ |=| (36 bars guitar solo)
Deep purple, the best
Technical Details
Message-ID:
<2220a4INNsrm@crcnis1.unl.edu>Path:
arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!ux1.cso.uiuc.edu!moe.ksu.ksu.edu!crcnis1.unl.edu!stevewReferences:
<SMILEY.93Jul9175300@maharet.im.hou.compaq.com> <1993Jul12.073948.7933@ericsson.se> <CA28DM.CKy@scr.siemens.com> <21t1aoINNhjc@crcnis1.unl.edu> <CA5x3K.5K0@scr.siemens.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10ba33,2a85f141102c1320 X-Google-Attributes: gid10ba33,public X-Google-Thread: 101a2b,2a85f141102c1320 X-Google-Attributes: gid101a2b,public X-Google-ArrivalTime: 1993-07-14 15:17:38 PST Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!ux1.cso.uiuc.edu!moe.ksu.ksu.edu!crcnis1.unl.edu!stevew From: stevew@helios.unl.edu (Steve Wu) Newsgroups: comp.windows.interviews,gnu.g++.help Subject: Re: Problem with GCC-2.4.5, and libg++-2.4 compiling IV-3.1... Date: 14 Jul 1993 22:11:16 GMT Organization: University of Nebraska--Lincoln Lines: 72 Message-ID: <2220a4INNsrm@crcnis1.unl.edu> References: <SMILEY.93Jul9175300@maharet.im.hou.compaq.com> <1993Jul12.073948.7933@ericsson.se> <CA28DM.CKy@scr.siemens.com> <21t1aoINNhjc@crcnis1.unl.edu> <CA5x3K.5K0@scr.siemens.com> NNTP-Posting-Host: helios.unl.edu