You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by "yjhjstz (via GitHub)" <gi...@apache.org> on 2025/05/31 02:50:15 UTC
[PR] Fix format attribute for gp_fatal_log to avoid clang build warning [cloudberry]
yjhjstz opened a new pull request, #1134:
URL: https://github.com/apache/cloudberry/pull/1134
Clang does not recognize 'gnu_printf' as a valid format type for functions using the standard printf-style formatting. This leads to warnings during compilation.
Change the format attribute for gp_fatal_log from 'gnu_printf' to 'printf' to ensure compatibility with clang while preserving format string checking.
Fixes #ISSUE_Number
### What does this PR do?
<!-- Brief overview of the changes, including any major features or fixes -->
### Type of Change
- [ ] Bug fix (non-breaking change)
- [ ] New feature (non-breaking change)
- [ ] Breaking change (fix or feature with breaking changes)
- [ ] Documentation update
### Breaking Changes
<!-- Remove if not applicable. If yes, explain impact and migration path -->
### Test Plan
<!-- How did you test these changes? -->
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Passed `make installcheck`
- [ ] Passed `make -C src/test installcheck-cbdb-parallel`
### Impact
<!-- Remove sections that don't apply -->
**Performance:**
<!-- Any performance implications? -->
**User-facing changes:**
<!-- Any changes visible to users? -->
**Dependencies:**
<!-- New dependencies or version changes? -->
### Checklist
- [ ] Followed [contribution guide](https://cloudberry.apache.org/contribute/code)
- [ ] Added/updated documentation
- [ ] Reviewed code for security implications
- [ ] Requested review from [cloudberry committers](https://github.com/orgs/apache/teams/cloudberry-committers)
### Additional Context
<!-- Any other information that would help reviewers? Remove if none -->
### CI Skip Instructions
<!--
To skip CI builds, add the appropriate CI skip identifier to your PR title.
The identifier must:
- Be in square brackets []
- Include the word "ci" and either "skip" or "no"
- Only use for documentation-only changes or when absolutely necessary
-->
---
<!-- Join our community:
- Mailing list: [dev@cloudberry.apache.org](https://lists.apache.org/list.html?dev@cloudberry.apache.org) (subscribe: dev-subscribe@cloudberry.apache.org)
- Discussions: https://github.com/apache/cloudberry/discussions -->
--
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
Re: [PR] Fix format attribute for gp_fatal_log to avoid clang build warning [cloudberry]
Posted by "yjhjstz (via GitHub)" <gi...@apache.org>.
yjhjstz commented on PR #1134:
URL: https://github.com/apache/cloudberry/pull/1134#issuecomment-2939927210
> @yjhjstz Please be careful to update the commit message when merge the PR.
OK
--
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
Re: [PR] Fix format attribute for gp_fatal_log to avoid clang build warning [cloudberry]
Posted by "gfphoenix78 (via GitHub)" <gi...@apache.org>.
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
Re: [PR] Fix format attribute for gp_fatal_log to avoid clang build warning [cloudberry]
Posted by "yjhjstz (via GitHub)" <gi...@apache.org>.
yjhjstz commented on code in PR #1134:
URL: https://github.com/apache/cloudberry/pull/1134#discussion_r2124234527
##########
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:
good, we can use `pg_attribute_printf` when avaliable.
--
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
Re: [PR] Fix format attribute for gp_fatal_log to avoid clang build warning [cloudberry]
Posted by "gfphoenix78 (via GitHub)" <gi...@apache.org>.
gfphoenix78 commented on PR #1134:
URL: https://github.com/apache/cloudberry/pull/1134#issuecomment-2938744769
@yjhjstz Please be careful to update the commit message when merge the PR.
--
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
Re: [PR] Fix format attribute for gp_fatal_log to avoid clang build warning [cloudberry]
Posted by "yjhjstz (via GitHub)" <gi...@apache.org>.
yjhjstz merged PR #1134:
URL: https://github.com/apache/cloudberry/pull/1134
--
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