Bug 5200

Summary: regex uses K&R definitions instead of ANSI C
Product: glibc Reporter: sds <sds>
Component: regexAssignee: Ulrich Drepper <drepper.fsp>
Status: RESOLVED WONTFIX    
Severity: normal CC: glibc-bugs-regex, glibc-bugs
Priority: P2 Flags: fweimer: security-
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Attachments: regexec ansi C patch
regcomp ansi C patch

Description sds 2007-10-19 15:16:50 UTC
regcomp.c and regexec.c use old K&R function definitions instead of the ANSI C.
this makes it impossible to compile regex with g++.
glibc regex is used by gnulib 
and thus by dozens of packages that import regex from gnulib.
this makes all those packages uncompilable with g++.
(even when the package is plain C, it is useful to compile it
with c++ every now and then to get a better type checking).
I have patched regcomp.c and regexec.c to compile with g++.
I don't see a way to attach a file though.
Comment 1 sds 2007-10-19 15:19:22 UTC
Created attachment 2055 [details]
regexec ansi C patch
Comment 2 sds 2007-10-19 15:20:01 UTC
Created attachment 2056 [details]
regcomp ansi C patch
Comment 3 Ulrich Drepper 2007-10-20 03:29:48 UTC
regex is C code, don't use a C++ compiler.  The use of K&R is deliberate and
will not be changed.