Master: clean some build warnings and CI not ignore warning, with make CFLAGS#999
Master: clean some build warnings and CI not ignore warning, with make CFLAGS#999gaoxueyu merged 6 commits intoIvorySQL:masterfrom
Conversation
WalkthroughTightened CI build flags and warnings; converted many previously exported globals to file-local Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
💤 Files with no reviewable changes (2)
🧰 Additional context used🧬 Code graph analysis (2)src/backend/utils/adt/ruleutils.c (1)
src/bin/psql/common.c (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
🔇 Additional comments (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/include/utils/ora_compatible.h (1)
61-61: Consider tightening the type or documentingbootstrap_database_modeDeclaring this here is fine for sharing the symbol, but since you already have a
DBModeenum, it may be clearer to either:
- declare it as
extern DBMode bootstrap_database_mode;, or- add a brief comment indicating the expected value range and lifecycle.
Not required for correctness, but would improve readability and reduce misuse.
.github/workflows/build.yml (1)
21-25: Stricter GCC toolchain and CFLAGS are consistent with “no warnings” CI goalInstalling gcc-14/g++-14 and adding
-Wshadow=compatible-localplus several-Werror=*flags is a direct way to enforce the new warning policy in CI; the YAML wiring looks correct. One thing to be aware of is thatmake CFLAGS="$CFLAGS ..."causes the environment’sCFLAGSto override configure’s computed flags, so any per-platform tuning in the Makefiles will be superseded here; that seems intentional but is worth keeping in mind if you later need platform-specific CFLAGS.Also applies to: 40-41
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (13)
.github/workflows/build.yml(2 hunks)contrib/gb18030_2022/utf8_and_gb18030_2022.c(1 hunks)contrib/ivorysql_ora/src/builtin_functions/datetime_datatype_functions.c(3 hunks)src/backend/access/transam/xlog.c(1 hunks)src/backend/commands/sequence.c(1 hunks)src/backend/oracle_parser/liboracle_parser.c(1 hunks)src/backend/parser/parse_param.c(1 hunks)src/backend/utils/misc/ivy_guc.c(1 hunks)src/bin/psql/psqlplusscan.l(1 hunks)src/include/utils/ora_compatible.h(1 hunks)src/oracle_test/isolation/isolation_main.c(1 hunks)src/oracle_test/isolation/specparse.y(1 hunks)src/pl/plisql/src/pl_gram.y(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-24T08:19:29.453Z
Learnt from: OreoYang
Repo: IvorySQL/IvorySQL PR: 931
File: src/backend/oracle_parser/ora_gram.y:0-0
Timestamp: 2025-10-24T08:19:29.453Z
Learning: In IvorySQL’s parser (src/backend/oracle_parser/ora_gram.y and related headers), downcase_identifier has the 4-argument signature:
extern char *downcase_identifier(const char *ident, int len, bool warn, bool truncate);
Applied to files:
src/backend/oracle_parser/liboracle_parser.csrc/backend/utils/misc/ivy_guc.c
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: meson_build (ubuntu-latest)
- GitHub Check: build (ubuntu-latest)
- GitHub Check: pg_regression (ubuntu-latest)
- GitHub Check: oracle_regression (ubuntu-latest)
- GitHub Check: oracle_pg_regression (ubuntu-latest)
- GitHub Check: contrib_regression
🔇 Additional comments (11)
src/backend/commands/sequence.c (1)
99-100: Restrictingsession_idandscale_valueto file scope looks correctBoth variables are only used within this module, so making them
staticis a good encapsulation step and should resolve any external linkage or duplicate-declaration warnings without changing behavior.src/backend/access/transam/xlog.c (1)
111-113: Removal of localexternin favor of header declaration looks goodRelying on
utils/ora_compatible.hfor thebootstrap_database_modedeclaration instead of a file‑localexternkeeps the interface centralized and avoids redundant or drifting declarations. No functional or behavioral changes introduced here.src/backend/oracle_parser/liboracle_parser.c (1)
48-53: Makeprev_quote_identifierfile‑local like the other saved hooksChanging
prev_quote_identifiertostaticaligns it with the other saved hook variables and avoids exporting an unnecessary global, with no behavioral change since it’s only used in this file.src/pl/plisql/src/pl_gram.y (1)
822-828: Drop unused local fromK_EXCEPTIONdecl armRemoving the dead
PLiSQL_exception_var *excassignment and just callingplisql_build_exceptionkeeps the behavior but fixes an unused‑but‑set variable under the stricter warning flags.src/backend/parser/parse_param.c (1)
74-76: Restrict OraParam stack globals to this fileMaking
TopOraParamNodeandCurrentOraParamNodestaticis appropriate since they’re only used inside parse_param.c and avoids exporting extra globals, which helps with the new-Werror=missing-variable-declarationspolicy. Just double‑check there are no remainingexterndeclarations for these names in other files.src/oracle_test/isolation/isolation_main.c (1)
21-23: Make isolation launcher globals internalMarking
saved_argv0,isolation_exec, andlooked_up_isolation_execasstaticis correct: they’re only used in this file, and this change just reduces symbol visibility without altering test behavior.src/bin/psql/psqlplusscan.l (1)
34-51: LimitNumKeywordsto this scanner fileChanging
NumKeywordstostatic const intis appropriate: it’s only used inside psqlplusscan.l, and this avoids exporting a superfluous global while satisfying-Werror=missing-variable-declarations.src/backend/utils/misc/ivy_guc.c (1)
37-39: Make NLS backing variables file‑local behind GUCMarking
nls_territory,nls_currency, andnls_iso_currencyasstaticis consistent with how they’re used: they’re only wired into the GUC tables in this compilation unit, and callers should go through the GUC APIs rather than referencing these globals directly. Just ensure there are no remainingexterndeclarations or direct uses of these symbols elsewhere, since those will now fail to link.src/oracle_test/isolation/specparse.y (1)
18-20: Add forward decls for bison parser globals to satisfy new warning flagsDeclaring
extern int spec_yychar;andextern int spec_yynerrs;in the grammar prologue addresses-Werror=missing-variable-declarationsby providing prior declarations for bison's generated globals. With%name-prefix="spec_yy"and a non-pure parser configuration, bison generates these as global (non-static) variables. Verify that your grammar uses a non-pure parser (no%pure-parseror%define api.pure) and confirm the bison version in your CI environment emits these symbols as documented.contrib/ivorysql_ora/src/builtin_functions/datetime_datatype_functions.c (1)
156-157: Manual verification required: External references to static const arrays cannot be checked.The review approves making
ora_days,date_fmt, anddate_timezonestatic const for proper encapsulation and to reduce global symbol pollution. However, the requested verification script could not be executed due to sandbox limitations preventing repository access.To complete this review, manually verify:
- No external references to these three arrays exist outside
datetime_datatype_functions.c- Run:
rg -n --type=c --type=h '\b(ora_days|date_fmt|date_timezone)\b'to search the entire codebase- Confirm all three arrays are indeed declared as
static constat lines 156-157, 172-184, and 198-204contrib/gb18030_2022/utf8_and_gb18030_2022.c (1)
25-26: LGTM: Appropriate use of static linkage for file-local hooks.These hook pointers are only used within
_PG_init()and_PG_fini()to save and restore previous hook handlers. Making themstaticcorrectly restricts their visibility to this translation unit and reduces global namespace pollution.
c2main
left a comment
There was a problem hiding this comment.
I didn't test, just a code review with few comments.
there are also bki generation which lead to some errors but are not caught by those changes:
./../src/include/catalog/pg_subscription.h ../../../src/include/catalog/pg_subscription_rel.h ../../../src/include/catalog/pg_package.h ../../../src/include/catalog/pg_package_body.h ../../../src/include/catalog/pg_force_view.h
invalid zero OID reference in pg_type.dat field typinput line 706
invalid zero OID reference in pg_type.dat field typoutput line 706
invalid zero OID reference in pg_type.dat field typinput line 712
invalid zero OID reference in pg_type.dat field typoutput line 712
invalid zero OID reference in pg_type.dat field typinput line 720
invalid zero OID reference in pg_type.dat field typoutput line 720
invalid zero OID reference in pg_type.dat field typinput line 727
invalid zero OID reference in pg_type.dat field typoutput line 727
invalid zero OID reference in pg_type.dat field typinput line 734
invalid zero OID reference in pg_type.dat field typoutput line 734
invalid zero OID reference in pg_type.dat field typinput line 740
invalid zero OID reference in pg_type.dat field typoutput line 740
invalid zero OID reference in pg_type.dat field typinput line 747
invalid zero OID reference in pg_type.dat field typoutput line 747
invalid zero OID reference in pg_type.dat field typinput line 754
invalid zero OID reference in pg_type.dat field typoutput line 754
invalid zero OID reference in pg_type.dat field typinput line 762
invalid zero OID reference in pg_type.dat field typoutput line 762
invalid zero OID reference in pg_type.dat field typinput line 769
invalid zero OID reference in pg_type.dat field typoutput line 769
invalid zero OID reference in pg_type.dat field typinput line 777
invalid zero OID reference in pg_type.dat field typoutput line 777
invalid zero OID reference in pg_type.dat field typinput line 782
invalid zero OID reference in pg_type.dat field typoutput line 782
invalid zero OID reference in pg_type.dat field typinput line 788
invalid zero OID reference in pg_type.dat field typoutput line 788
touch bki-stamp
``
| /* PLiSQL_exception_var *exc; | ||
|
|
||
| exc = plisql_build_exception($1.name, $1.lineno, true); | ||
| exc = */ |
There was a problem hiding this comment.
it looks like strange wrapping with comment here...
There was a problem hiding this comment.
it looks like strange wrapping with comment here...
What i want to fix is
pl_gram.y:824:71: warning: variable ‘exc’ set but not used [-Wunused-but-set-variable]
There was a problem hiding this comment.
maybe it deserves a comment or just remove the code, it'll be easier to read...
Yes, that's true. But, this part was addressed in another PR #993, and we forgot to mention it. |
BTW, these warnings are generated by Perl code. |
yes, that's a fragile part, and surely not on the shoulders of ivorysql, maybe an improvement for upstream... |
We resolved some warning logs triggered by -Wdeclaration-after-statement but not included
-Werror=declaration-after-statementin file.github/workflows/build.ymlbecause we considered that the code imported from Ryu is exempt from the declaration-after-statement rule, in order to keep it more closely aligned with its upstream. The following segment would cause errors:Summary by CodeRabbit
Refactor
Chores / Build
Behavior
✏️ Tip: You can customize this high-level summary in your review settings.