bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

inconditional alloca.h inclusion in sed-4.1.5


From: Juan Manuel Guerrero
Subject: inconditional alloca.h inclusion in sed-4.1.5
Date: Mon, 6 Feb 2006 16:01:54 +0100
User-agent: KMail/1.8.2

I dont know if this has already reported.
While I was tried to compile sed-4.1.5 on MSDOS using djgpp
the compilation aborted with the following error message:

gcc -DHAVE_CONFIG_H -I. -I. -I..  -I../lib -I../intl -I.. -I../lib -I../intl   
-g -O2 -c regex.c
In file included from regex.c:61:
regex_internal.h:413:20: error: alloca.h: No such file or directory (ENOENT)
make.exe[2]: *** [regex.o] Error 1
make.exe[2]: Leaving directory `d:/p/sed-4.1.5/lib'
make.exe[1]: *** [all-recursive] Error 1
make.exe[1]: Leaving directory `d:/p/sed-4.1.5'
make.exe: *** [all] Error 2

The sources are configured using the configure script shiped with
the sources. This configure script cleanly detects that no alloca.h is availabe
in djgpp's libc but for some reason in regex_internal.h alloca.h is 
inconditionaly
included. The small patch below solves the difficulty. After fixing this the
sources compiled and the testsuite passed flawless. Please note that I dont know
if this is really the best aproach to solve this issue. It is up to the people
with real insight in sed's code to decide how to solve this issue.

Regards,
Juan Manuel Guerrero


diff -aprNU5 sed-4.1.5.orig/lib/regex_internal.h sed-4.1.5/lib/regex_internal.h
--- sed-4.1.5.orig/lib/regex_internal.h 2005-12-06 08:50:56.000000000 +0000
+++ sed-4.1.5/lib/regex_internal.h      2006-02-05 22:43:24.000000000 +0000
@@ -408,11 +408,13 @@ static unsigned int re_string_context_at
 #define re_string_length(pstr) ((pstr)->len)
 #define re_string_byte_at(pstr,idx) ((pstr)->mbs[idx])
 #define re_string_skip_bytes(pstr,idx) ((pstr)->cur_idx += (idx))
 #define re_string_set_index(pstr,idx) ((pstr)->cur_idx = (idx))
 
-#include <alloca.h>
+#if HAVE_ALLOCA_H
+# include <alloca.h>
+#endif
 
 #ifndef _LIBC
 # if HAVE_ALLOCA
 /* The OS usually guarantees only one guard page at the bottom of the stack,
    and a page size can be as small as 4096 bytes.  So we cannot safely




reply via email to

[Prev in Thread] Current Thread [Next in Thread]