From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23135 invoked by alias); 11 Apr 2006 06:58:11 -0000 Received: (qmail 23117 invoked by uid 48); 11 Apr 2006 06:58:08 -0000 Date: Tue, 11 Apr 2006 06:58:00 -0000 Message-ID: <20060411065808.23116.qmail@sourceware.org> From: "eggert at gnu dot org" To: glibc-bugs-regex@sources.redhat.com In-Reply-To: <20050824222100.1236.eggert@gnu.org> References: <20050824222100.1236.eggert@gnu.org> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug regex/1236] regex.h violates POSIX name space rules in several places X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-regex-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-regex-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00004.txt.bz2 List-Id: ------- Additional Comments From eggert at gnu dot org 2006-04-11 06:58 ------- I will attach a revised patch, now used in gnulib, which is much more conservative. The revised patch leaves almost all the names alone in the normal case, and this addresses most of the objections. If the user compiles pedantically (e.g. by defining _POSIX_C_SOURCE), the patched regex.h simply does not define the offending names; that suffices to conform. I didn't quite follow this objection, though: > While true that this violates the name space, no other names are reserved > either. I take this to claim that names beginning with "re_" are not reserved. However, XSI section 2.2.2 page 16 line 613 says that implementations can define symbols with the prefixes re_ and rm_, in the same sense that can define symbols with the prefixes E[0-9A-Z]. Users therefore can't define re_* and rm_* macros before including , just as they can't define an E[0-9A-Z] macro before including . So, in that sense, the re_* and rm_* names are free for use within . This may help to explain why Solaris 10 regex_t can have members like "re_sc" and "re_len"; this is an allowed extension to the standard. PS. For the record, the glibc identifiers that violate the POSIX name space include macro names like RE_BACKSLASH_ESCAPE_IN_LISTS, RE_SYNTAX_AWK, RE_DUP_MAX, RE_TRANSLATE_TYPE, REGS_FIXED, and RE_NREGS; and member names like buffer, allocated, start, and end. For example, here is a program that strictly conforms to POSIX, and works on Solaris 10, but doesn't work with glibc: #define _POSIX_C_SOURCE 200112L #define buffer 0 #define start 0 #include int RE_BACKSLASH_ESCAPE_IN_LISTS; int RE_SYNTAX_AWK; int RE_DUP_MAX; int RE_TRANSLATE_TYPE; int REGS_FIXED; int RE_NREGS; int main (void) { return 0; } -- http://sourceware.org/bugzilla/show_bug.cgi?id=1236 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.