Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Harald Koenig <koenig@tat.physik.uni-tuebingen.de>
Subject: Re: string.h, strlen(), warnings from gcc
Date: Mon, 17 Jun 1996 12:04:10 +0200 (MET DST)	[thread overview]
Message-ID: <199606171006.MAA22489@ceres.tat.physik.uni-tuebingen.de> (raw)
In-Reply-To: <Pine.SUN.3.90.960617020120.8650B-100000@ant>

> Can anyone explain why I should need to explicitly specify extern 
> strlen() after including <string.h> for the following simple example?
> 
> fresco@banshee:/tmp $ cat a.c
> #include <string.h>
> 
> /*extern size_t strlen(const char *ptr);*/
> 
> size_t z(const char *y)
> {
>     return strlen(y);
> }
> fresco@banshee:/tmp $ cc a.c
> a.c: In function `z':
> a.c:7: warning: type mismatch in implicit declaration for built-in function `strlen'

for such problems I usually check the preprocessor output if/where
the prototype is declared and which include files are really included:

	cc -E a.c | more

looking for "strlen" and/or filenames of include files...

Harald

-- 
All SCSI disks will from now on                     ___       _____
be required to send an email notice                0--,|    /OOOOOOO\
24 hours prior to complete hardware failure!      <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig,                                         \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik                              //  /     \\  \
koenig@tat.physik.uni-tuebingen.de                     ^^^^^       ^^^^^

  parent reply	other threads:[~1996-06-17 10:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.SUN.3.90.960617020120.8650B-100000@ant>
1996-06-17  3:28 ` string.h, strlen(), warnings from gcc Richard Henderson
1996-06-17 17:22   ` David Fell
1996-06-17 10:04 ` Harald Koenig [this message]
     [not found] <Pine.LNX.3.91.960617181918.17165A-100000@chaos.chaos.org.uk>
1996-06-17 20:51 ` Richard Henderson
1996-06-17 16:21 David Mosberger-Tang
  -- strict thread matches above, loose matches on Subject: below --
1996-06-17  1:04 David
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox