Cant compile on SuSE Enterprise Server 10
Compilation error:
gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -I./sf_mem -I./sf_core -I./sf_cfg -I./sf_cgi -I./sf_fmt -I./sf_fpos -I./sf_mime -I./sf_sed -I./sf_time -g -O2 -MT sed.lo -MD -MP -MF .deps/sed.Tpo -c sf_sed/sed.c -fPIC -DPIC -DPIC -o sed.o
sf_sed/sed.c: In function ‘sed_compile’:
sf_sed/sed.c:103: error: invalid lvalue in assignment
sf_sed/sed.c: In function ‘sed_exec’:
sf_sed/sed.c:580: error: invalid lvalue in assignment
sf_sed/sed.c:597: error: invalid lvalue in assignment
make[2]: *** [sed.lo] Error 1
make[2]: Leaving directory `/usr/src/libstrfunc-8.2'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/libstrfunc-8.2'
make: *** [all] Error 2
Versions:
GCC 4.1
GNU Make 3.8
GLibC 2.4
Logged In: YES
user_id=1094870
Originator: NO
Patch to fix this compilation error:
--- libstrfunc-8.2/sf_sed/sed.c 2005-05-25 17:55:10.000000000 -0400
+++ libstrfunc-8.2-patch/sf_sed/sed.c 2007-01-15 16:46:19.000000000 -0400
@@ -100,7 +100,7 @@
}
*pstrt = 0;
- for((const char *)c = expr; *c; c++) {
+ for(c = (char *)expr; *c; c++) {
if(*c == '\\') {
if(*++c == dlm) {
*pstrt++ = dlm;
@@ -577,7 +577,7 @@
if(se->rexopt & REG_ICASE) {
- for((const char *)s = string; (cs=*s); s++) {
+ for(s = (char *)string; (cs=*s); s++) {
cs = tolower(cs);
for(c = sfr; *c; c++)
if(cs == *c)
@@ -594,7 +594,7 @@
} else {
- for((const char *)s = string; (cs=*s); s++) {
+ for(s = (char *)string; (cs=*s); s++) {
for(c = sfr; *c; c++)
if(cs == *c)
break;