Change [:space:] to [[:space:]] in awk scripts (dotnet/coreclr#25670)
authorOmair Majid <omajid@redhat.com>
Wed, 17 Jul 2019 15:49:31 +0000 (11:49 -0400)
committerJan Vorlicek <janvorli@microsoft.com>
Wed, 17 Jul 2019 15:49:30 +0000 (17:49 +0200)
During coreclr build on RHEL 7, awk prints out some warnings:

    awk: /builddir/build/BUILD/dotnet-v2.2.6/src/coreclr/generateredefinesfile.awk:10:
    warning: regexp component `[:space:]' should probably be `[[:space:]]'

The awk man page says:

    A character class is only valid in a regular expression inside the
    brackets of a character list.

So fix the '[:space:]' notation by replacing with the valid
'[[:space:]]'.

Fixing this warning doesn't actually result in a change in the generated
files (dbgshim.exports, mscordbi.exports, libredefines.inc,
palredefines.inc, clrjit.exports, mscordac.exports, coreclr.exports,
dlltest1.exports and dlltest2.exports) on my system.

Commit migrated from https://github.com/dotnet/coreclr/commit/90de19f0c55615982f8a787cf4acecf2debe6e17

src/coreclr/generateexportedsymbols.awk
src/coreclr/generateredefinesfile.awk

index 120897fa378d65a33adfddd331c87324bcabe1d7..69a8a8e6df5cf2bf175fae9653065d29bfc1ca2d 100644 (file)
@@ -4,7 +4,7 @@
     gsub(/\r/,"", $0);
 
     # Skip empty lines and comment lines starting with semicolon
-    if (NF && !match($0, /^[:space:]*;/))
+    if (NF && !match($0, /^[[:space:]]*;/))
     {
         gsub(/^#/,"", $0);
         print "_"  $0;
index 592c19a5dd8aa325d32685eb5c60b4df42d00266..e2131e582156908aff2fb043c7cd96d74ce37777 100644 (file)
@@ -7,7 +7,7 @@
     gsub(/\r/,"", $0);
     
     # Skip empty lines and comment lines starting with semicolon
-    if (NF && !match($0, /^[:space:]*;/))
+    if (NF && !match($0, /^[[:space:]]*;/))
     {
         # Only process the entries that begin with "#"
         if (match($0, /^#.*/))