Re: strlen problems
Re: strlen problems
- Subject: Re: strlen problems
- From: "D. Walsh" <email@hidden>
- Date: Sat, 5 Nov 2005 11:59:43 -0500
- Mta-interface: amavisd-new-2.3.3 (20050822) at daleenterprise.com
On Nov 5, 2005, at 07:54 , Nat! wrote:
Am 05.11.2005 um 12:10 schrieb D. Walsh:
I've been converting all of my old Xcode 1.1 projects to Xcode 2.2
utilizing gcc 4.0 since the migration to 10.4.
I have hundreds of programs with lines using strlen that were
taken from example code back in the days of gcc 2.95 that built
without issues right up to the migration to 10.4 and this issue
seem to render the apps un-executable.
If I remove these lines from the source code they build and
execute without issue however important information is missing
from the output so a solution is needed.
Here's the message I get:
warning: incompatible implicit declaration of built-in function
'strlen'
Here's a sample of an offensive line: (others are similar but only
the lines using strlen in this systax cause problems)
if (strlen (path_info)) printf ("path_info: %s<br>\n", path_info);
Has anyone encountered this issue and/or have a solution???
The reason for the warning is, that you didn't include <string.h>.
Hence the "implicit declaration". The compiler assumes then that
the return parameter is int, but it really turns out to be size_t.
The solution is to either #include <string.h> in each file that
uses strlen or to simply ignore the warning.
Nat!
Why was this not required before???
Why if I change to gcc 3.3 I don't get the error, is <string.h>
available on all platforms???
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden