You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by "gfphoenix78 (via GitHub)" <gi...@apache.org> on 2025/06/03 01:31:27 UTC

Re: [PR] Fix format attribute for gp_fatal_log to avoid clang build warning [cloudberry]

gfphoenix78 commented on code in PR #1134:
URL: https://github.com/apache/cloudberry/pull/1134#discussion_r2122427627


##########
src/bin/pg_upgrade/util.c:
##########
@@ -273,7 +273,7 @@ check_ok(void)
  *  respected.
  */
 void
-gp_fatal_log(const char *fmt,...)  __attribute__ ((format (gnu_printf, 1, 2)));
+gp_fatal_log(const char *fmt,...)  __attribute__ ((format (printf, 1, 2)));

Review Comment:
   Some code may still use gnu_printf. Please search the following symbols: gnu_printf & PG_PRINTF_ATTRIBUTE
   
   ```
   gpadmin@hashdata:~/ws/lightning$ git grep -nw gnu_printf
   config/c-compiler.m4:8:# We prefer "gnu_printf", as that most closely matches the features supported
   config/c-compiler.m4:14:[pgac_cv_printf_archetype=gnu_printf
   config/c-compiler.m4:24:[Define to best printf format archetype, usually gnu_printf if available.])
   configure:17914:  pgac_cv_printf_archetype=gnu_printf
   src/Makefile.global.in:1161:# -Wno-ignored-attributes added so gnu_printf doesn't trigger
   src/bin/pg_upgrade/util.c:276:gp_fatal_log(const char *fmt,...)  __attribute__ ((format (gnu_printf, 1, 2)));
   src/include/gppc/gppc.h:1912:#define PG_PRINTF_ATTRIBUTE gnu_printf
   src/include/pg_config.h.in:929:/* Define to best printf format archetype, usually gnu_printf if available. */
   gpadmin@hashdata:~/ws/lightning$ git grep -nw PG_PRINTF_ATTRIBUTE
   config/c-compiler.m4:23:AC_DEFINE_UNQUOTED([PG_PRINTF_ATTRIBUTE], [$pgac_cv_printf_archetype],
   configure:17970:#define PG_PRINTF_ATTRIBUTE $pgac_cv_printf_archetype
   gpcontrib/gpmapreduce/src/mapred.c:106: __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3)));
   gpcontrib/gpmapreduce/src/parse.c:12:   __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3)));
   src/backend/gporca/libgpos/include/gpos/attributes.h:8:#define GPOS_FORMAT_ARCHETYPE PG_PRINTF_ATTRIBUTE
   src/include/c.h:163:#define pg_attribute_printf(f,a) __attribute__((format(PG_PRINTF_ATTRIBUTE, f, a)))
   src/include/gppc/gppc.h:1910:#ifndef PG_PRINTF_ATTRIBUTE
   src/include/gppc/gppc.h:1912:#define PG_PRINTF_ATTRIBUTE gnu_printf
   src/include/gppc/gppc.h:1914:#define PG_PRINTF_ATTRIBUTE printf
   src/include/gppc/gppc.h:1928:__attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3)));
   src/include/pg_config.h.in:930:#undef PG_PRINTF_ATTRIBUTE
   src/tools/msvc/Solution.pm:471:         PG_PRINTF_ATTRIBUTE => undef,
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org