[Bug c/22389] New: strlen from Function possible
kleinalex at gmx dot at
gcc-bugzilla@gcc.gnu.org
Sat Jul 9 19:29:00 GMT 2005
Boyer-Search.c file:
int Search (char search[],char Text[]){
unsigned int Plen = strlen(Search)-1; // The Bug! S instead of s
unsigned int Textlength = strlen(Text)-1;
int Pattern[256];
int i;int j;int k;
int Position = Plen;
for (i = 0; i < 256; i++){
Pattern[i] = Plen;
}
for (i = Plen; i > 0; i--){
Pattern[search[i]] = i;
}
do {
j = Plen;
k = Position;
do {
j--;
k--;
} while (search[j] == Text[k] && j >= 0);
Position = Position + Pattern[Text[k]];
} while (Position < Textlength && j >= 0);
return Position;
}
gcc-4.0 -pg -ggdb -gstabs+ -fprofile-arcs -ftest-coverage -Wall -o BoyerMoore_Te
xtSuche Boyer-Search.c main.c
Boyer-Search.c: In function ÂSearchÂ:
Boyer-Search.c:3: Warnung: implizite Deklaration der Funktion ÂstrlenÂ
Boyer-Search.c:3: Warnung: unverträgliche implizite Deklaration der eingebauten
Funktion ÂstrlenÂ
Boyer-Search.c:3: Warnung: Ãbergabe des Arguments 1 von Âstrlen von inkompatibl
em Zeigertyp
Boyer-Search.c:14: Warnung: Feldindex hat Typ ÂcharÂ
Boyer-Search.c:24: Warnung: Feldindex hat Typ ÂcharÂ
gcc give only warnings!
--
Summary: strlen from Function possible
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kleinalex at gmx dot at
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22389
More information about the Gcc-bugs
mailing list