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

Re: [Patches] int/hex/string option types



On 12/05/2011 05:43 PM, Joseph S. Myers wrote:
On Mon, 28 Nov 2011, Steve Longerbeam wrote:

diff -Nupbar -X /home/stevel/dontdiff eglibc.orig/libc/scripts/option-groups.awk eglibc/libc/scripts/option-groups.awk
--- eglibc.orig/libc/scripts/option-groups.awk	2011-11-22 17:32:21.356911312 -0800
+++ eglibc/libc/scripts/option-groups.awk	2011-11-23 15:08:37.792003410 -0800
@@ -46,9 +46,13 @@ END {
                  print "#define __" var " 1"
              else if (vars[var] == "n")
                  print "/* #undef __" var " */"
-            # Ignore variables that don't have boolean values.
-            # Ideally, this would be driven by the types given in
-            # option-groups.def.
+	    else if (vars[var] ~ /^0*x*[0-9]+/ || vars[var] ~ /\"\w*\"/)
I'm not clear on the integer syntax you're expecting to match with
/^0*x*[0-9]+/, but if hex integers are possible (presumably, since you're
allowing 'x') I'd have thought you need to allow for letters a-f after
them.  (Unless this script will only ever run in the C locale, you don't
actually want to use "a-f" directly in a range, since in some locales that
will include other letters as well; spell out all the possible letters
explicitly.)

argh, thanks for catching that. Will fix.


\"\w*\" also looks wrong for the string syntax; strings such as file names
may well not be restricted to word (alphanumeric and underscore)
characters.

true. I'll relax the match chars between the doubloe quotes.

Steve


--
Steve Longerbeam | Senior Embedded Engineer, ESD Services
Mentor Embedded(tm) | 46871 Bayside Parkway, Fremont, CA 94538
P 510.354.5838 | M 408.410.2735
Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS

_______________________________________________
Patches mailing list
Patches@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/patches