From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199606171006.MAA22489@ceres.tat.physik.uni-tuebingen.de> Date: Mon, 17 Jun 1996 12:04:10 +0200 (MET DST) From: Harald Koenig Subject: Re: string.h, strlen(), warnings from gcc In-Reply-To: > Can anyone explain why I should need to explicitly specify extern > strlen() after including for the following simple example? > > fresco@banshee:/tmp $ cat a.c > #include > > /*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 ^^^^^ ^^^^^