autoconf-patches
[Top][All Lists]
Advanced

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

Re: Fix for ifnames and test for it


From: Pavel Roskin
Subject: Re: Fix for ifnames and test for it
Date: Thu, 2 Nov 2000 11:38:42 -0500 (EST)

Hello, Akim!

>       while (match(substr(fs, i), /^ [^ ]*/) \
> -            && substr(fs, i + 1, RLENGTH - 1) < FILENAME)
> -        {
> +            && substr(fs, i + 1, RLENGTH - 1) < FILENAME) {
> 
> Are you really sure we need this?  I don't think so.  I am not in
> favor of this change.  In regard to the code of autoconf.sh only END
> deserves this special treatment.  Since, IMHO, the change above is
> obfuscating the code, I'm not in favor of it.

Not only END, but also other patterns, such as /^[\t ]*#/

Actually, I didn't say that we need something. I just reverted the changes
between the revisions 1.17 and 1.18 that were not related to copyrights.

It's a very formal apporach, I know, but I try to avoid doing many things
in the same time.

The code was working (we don't know how well, but it did). Then some
changes were submitted that broke it. It is clear from the description of
the changes that they were commited accidentally.

My patch does one thing - it reverts the changes that you didn't want to
commit at that time.

If you want some of those changes to be committed you are free to send a
patch.

PS. I reread the above and decided that I'm too cruel. Ignore all the
above if you want :-)

ChangeLog:
        * ifnames.sh: Put the opening brace on the same line with
        patterns.
        * tests/tools.at (AWK portability): Check ifnames.
        (ifnames): New test for ifnames.

Regards,
Pavel Roskin

___________________________
Index: ifnames.sh
--- ifnames.sh  Wed Nov  1 14:30:56 2000
+++ ifnames.sh  Thu Nov  2 11:30:37 2000
@@ -103,8 +103,7 @@
     }
   }
 
-  /^[\t ]*#/
-  {
+  /^[\t ]*#/ {
     if (sub(/^[\t ]*#[\t ]*ifn?def[\t ]+/, "", $0))
     {
       sub(/[^A-Za-z_0-9].*/, "", $0)
@@ -125,8 +124,7 @@
     }
   }
 
-  END
-  {
+  END {
     for (sym in files)
     {
       print sym files[sym]
Index: tests/tools.at
--- tests/tools.at      Thu Nov  2 11:07:28 2000
+++ tests/tools.at      Thu Nov  2 11:26:33 2000
@@ -368,6 +368,55 @@
   # Tracing.
   AT_CHECK([AWK='gawk --posix' autoconf --autoconf-dir .. -l $at_srcdir -t 
AC_INIT], 0,
            ignore, [])
+  # Syntax correctness of ifnames.
+  AT_CHECK([AWK='gawk --posix' ifnames empty], 0,
+           [], [])
 fi
+
+AT_CLEANUP(configure)
+
+
+
+
+
+## --------- ##
+## ifnames.  ##
+## --------- ##
+
+AT_SETUP(ifnames)
+
+AT_DATA([iftest1.c],
+[[#ifdef DEF1
+#ifndef DEF2
+#if !defined(DEF3) && defined(DEF4) /* but not defined(DEF5) */
+    # if SPACES
+       #       if      TABS
+/* #if C_COMMENTS */
+// #if CXX_COMMENTS
+#if LINE1 = \
+LINE2
+#if (VAL1*VAL2)==VAL3+VAL4 /* Not VAL5 !!! */
+]])
+
+AT_DATA([iftest2.c],
+[[#ifdef IFTEST2
+#if VAL1
+]])
+
+AT_CHECK([ifnames iftest1.c iftest2.c], 0,
+[DEF1 iftest1.c
+DEF2 iftest1.c
+DEF3 iftest1.c
+DEF4 iftest1.c
+IFTEST2 iftest2.c
+LINE1 iftest1.c
+LINE2 iftest1.c
+SPACES iftest1.c
+TABS iftest1.c
+VAL1 iftest1.c iftest2.c
+VAL2 iftest1.c
+VAL3 iftest1.c
+VAL4 iftest1.c
+], [])
 
 AT_CLEANUP(configure)
___________________________





reply via email to

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