This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug regex/1236] regex.h violates POSIX name space rules in several places
- From: "drepper at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 6 Sep 2005 20:03:16 -0000
- Subject: [Bug regex/1236] regex.h violates POSIX name space rules in several places
- References: <20050824222100.1236.eggert@gnu.org>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From drepper at redhat dot com 2005-09-06 20:03 -------
There is no reason to rename REG_NOERROR etc. The definitions are correct.
There is also no requirement to have them as macros.
And stop making gratuitous changes like
-#define RE_DUP_MAX (0x7fff)
+/* Maximum number of duplicates an interval can allow. This is
+ distinct from RE_DUP_MAX, to conform to POSIX name space rules and
+ to avoid collisions with <limits.h>. */
+#define REG_DUP_MAX 32767
Broken code which tries to use the macro in preprocessor arithmetic cannot
mysteriously start working.
Likewise
-#define REG_ICASE (REG_EXTENDED << 1)
+#define REG_ICASE (1 << 1)
Nobody asked you for your opinion on how to write that code. What you think is
irrelevant. Leave the code alone.
+/* In the traditional GNU implementation, regex.h defined member names
+ like `buffer' that POSIX does not allow. These members now have
+ names with leading `re_' (e.g., `re_buffer'). Support the old
+ names only if _REGEX_SOURCE is defined. New programs should use
+ the new names. */
While true that this violates the name space, no other names are reserved
either. It makes no sense to changed this until the specification is changed.
+ unsigned char *_REG_RE_NAME (buffer);
- /* Number of bytes to which `buffer' points. */
- unsigned long int allocated;
+ /* Number of bytes to which `re_buffer' points. */
The new comments are more confusing. Just leave them as they are. People
reading the header only see _REG_RE_NAME(buffer) which mentions 'buffer' but no
're_buffer'.
+#define REG_UNALLOCATED 0
+#define REG_REALLOCATE 1
+#define REG_FIXED 2
No. Add a REG_ prefix if anything has to be done. REG_REGS_UNALLOCATED.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |WAITING
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.