diff --git a/meta-oniro-core/recipes-support/libpcre/libpcre2_%.bbappend b/meta-oniro-core/recipes-support/libpcre/libpcre2_%.bbappend
index aa54e193359331af9b58a123279b1fa859db933b..7614326f957b5f01ee7908d0116d0ed1bf8a64eb 100644
--- a/meta-oniro-core/recipes-support/libpcre/libpcre2_%.bbappend
+++ b/meta-oniro-core/recipes-support/libpcre/libpcre2_%.bbappend
@@ -9,4 +9,4 @@
 # Removing -Werror=array-bounds here allows us to use -Werror=array-bounds
 # globally in OPTIMIZE_FOR=security mode.
 
-TARGET_CFLAGS_remove = "-Werror=array-bounds"
+TARGET_CFLAGS:remove = "-Werror=array-bounds"