This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/main by this push:
     new 82bc99c670f Fix gawk regexp escape sequence warning
82bc99c670f is described below

commit 82bc99c670fc79725f153a7d00121f507df1366d
Author: zhan7236 <[email protected]>
AuthorDate: Thu Nov 27 14:50:23 2025 +0000

    Fix gawk regexp escape sequence warning
    
    Fix issue #1206: Replace [^\#] with [^\043] in AWK regex patterns.
    
    The original [^\#] caused a gawk warning:
      'regexp escape sequence `#' is not a known regexp operator'
    
    The initial fix of changing to [^#] broke the build because Make
    interprets # as a comment character, truncating the command.
    
    This fix uses the octal escape sequence \043 (ASCII code for #)
    which:
    1. Is properly escaped for Make (not interpreted as comment)
    2. Is a valid AWK/regex escape sequence (no warning)
    3. Works with both gawk and mawk
    
    Changes:
    - src/Makefile.shlib: 5 occurrences updated
    - src/backend/Makefile: 2 occurrences updated
---
 src/Makefile.shlib   | 10 +++++-----
 src/backend/Makefile |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/Makefile.shlib b/src/Makefile.shlib
index b8cbc96b28b..50214226de6 100644
--- a/src/Makefile.shlib
+++ b/src/Makefile.shlib
@@ -130,7 +130,7 @@ ifeq ($(PORTNAME), darwin)
     DLSUFFIX           = .so
     LINK.shared                = $(COMPILER) -bundle -multiply_defined suppress
   endif
-  BUILD.exports                = $(AWK) '/^[^\#]/ {printf "_%s\n",$$1}' $< >$@
+  BUILD.exports                = $(AWK) '/^[^\043]/ {printf "_%s\n",$$1}' $< 
>$@
   exports_file         = $(SHLIB_EXPORTS:%.txt=%.list)
   ifneq (,$(exports_file))
     exported_symbols_list = -exported_symbols_list $(exports_file)
@@ -142,7 +142,7 @@ ifeq ($(PORTNAME), openbsd)
   ifdef soname
     LINK.shared                += -Wl,-x,-soname,$(soname)
   endif
-  BUILD.exports                = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf 
"%s;\n",$$1}' $<; echo ' local: *; };' ) >$@
+  BUILD.exports                = ( echo '{ global:'; $(AWK) '/^[^\043]/ 
{printf "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@
   exports_file         = $(SHLIB_EXPORTS:%.txt=%.list)
   ifneq (,$(exports_file))
     LINK.shared                += -Wl,--version-script=$(exports_file)
@@ -158,7 +158,7 @@ ifeq ($(PORTNAME), freebsd)
   ifdef soname
     LINK.shared                += -Wl,-x,-soname,$(soname)
   endif
-  BUILD.exports                = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf 
"%s;\n",$$1}' $<; echo ' local: *; };' ) >$@
+  BUILD.exports                = ( echo '{ global:'; $(AWK) '/^[^\043]/ 
{printf "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@
   exports_file         = $(SHLIB_EXPORTS:%.txt=%.list)
   ifneq (,$(exports_file))
     LINK.shared                += -Wl,--version-script=$(exports_file)
@@ -170,7 +170,7 @@ ifeq ($(PORTNAME), netbsd)
   ifdef soname
     LINK.shared                += -Wl,-x,-soname,$(soname)
   endif
-  BUILD.exports                = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf 
"%s;\n",$$1}' $<; echo ' local: *; };' ) >$@
+  BUILD.exports                = ( echo '{ global:'; $(AWK) '/^[^\043]/ 
{printf "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@
   exports_file         = $(SHLIB_EXPORTS:%.txt=%.list)
   ifneq (,$(exports_file))
     LINK.shared                += -Wl,--version-script=$(exports_file)
@@ -215,7 +215,7 @@ ifeq ($(PORTNAME), linux)
   ifdef soname
     LINK.shared                += -Wl,-soname,$(soname)
   endif
-  BUILD.exports                = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf 
"%s;\n",$$1}' $<; echo ' local: *; };' ) >$@
+  BUILD.exports                = ( echo '{ global:'; $(AWK) '/^[^\043]/ 
{printf "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@
   exports_file         = $(SHLIB_EXPORTS:%.txt=%.list)
   ifneq (,$(exports_file))
     LINK.shared                += -Wl,--version-script=$(exports_file)
diff --git a/src/backend/Makefile b/src/backend/Makefile
index 44dbe7f0e15..210adcccf84 100644
--- a/src/backend/Makefile
+++ b/src/backend/Makefile
@@ -95,14 +95,14 @@ SYMBOL_MAPPING_FLAGS =
 ifeq ($(PORTNAME), darwin)
 SYMBOL_MAP_FILE = hide_symbols.list
 $(SYMBOL_MAP_FILE): $(top_builddir)/src/interfaces/libpq/exports.txt
-       $(AWK) '/^[^\#]/ {printf "_%s\n",$$1}' $< | grep -v -E 
$(SAFELY_EXPORTED_SYMBOLS_PATTERN) >$@
+       $(AWK) '/^[^\043]/ {printf "_%s\n",$$1}' $< | grep -v -E 
$(SAFELY_EXPORTED_SYMBOLS_PATTERN) >$@
 SYMBOL_MAPPING_FLAGS = -unexported_symbols_list $(SYMBOL_MAP_FILE)
 endif
 
 ifeq ($(PORTNAME), linux)
 SYMBOL_MAP_FILE = postgres_symbols.map
 $(SYMBOL_MAP_FILE): $(top_builddir)/src/interfaces/libpq/exports.txt
-       ( echo '{ global: *; '; echo ' local:'; $(AWK) '/^[^\#]/ {printf 
"%s;\n",$$1}' $< | grep -v -E $(SAFELY_EXPORTED_SYMBOLS_PATTERN); echo '};' ) 
>$@
+       ( echo '{ global: *; '; echo ' local:'; $(AWK) '/^[^\043]/ {printf 
"%s;\n",$$1}' $< | grep -v -E $(SAFELY_EXPORTED_SYMBOLS_PATTERN); echo '};' ) 
>$@
 SYMBOL_MAPPING_FLAGS = -Wl,--version-script=$(SYMBOL_MAP_FILE)
 endif
 ifeq ($(enable_shared_postgres_backend),yes)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to