Repository navigation
fix: clean existing warnings for Clang -Werror - #1451
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (5)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe change adds explicit casts at Oracle package and prompt-status boundaries. It also adds regression assertions for timestamp parsing with an empty NLS parameter. ChangesOracle compatibility updates
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change fixes Clang warning paths and makes existing conversions explicit, with the reported build and regression checks passing; no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Thanks for your contribution! I will review it as soon as possible. |
|
This PR is highly valuable. Not only does it eliminate Clang compilation warnings, but the modifications to Since the current test cases do not trigger the code path for this bug, could you please add the relevant test cases to |
|
Thanks for the review. I added regression cases for both three-argument functions in |
The three-argument timestamp functions accept nlsparam for compatibility but do not interpret it. Parse the input unconditionally so the timestamp fields are always initialized before conversion. Assisted-by: OpenAI:gpt-5
Route the package parser enum through uintptr_t and explicitly cast between the PostgreSQL and Oracle prompt enums. This documents the existing representation conversions and keeps Clang's -Wenum-conversion and -Wvoid-pointer-to-enum-cast clean. Assisted-by: OpenAI:gpt-5
4d9e7d2 to
d9e6119
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
contrib/ivorysql_ora/sql/datatype_and_func_bugs.sql (1)
5-19: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert the parsed values independently.
These checks only verify that the three-argument calls match the two-argument calls. Add an assertion against known expected timestamp values as well, so a shared regression in both paths cannot make the test pass.
As per path instructions, SQL tests should ensure comprehensive feature coverage.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@contrib/ivorysql_ora/sql/datatype_and_func_bugs.sql` around lines 5 - 19, Update the two timestamp regression checks around sys.to_timestamp and sys.to_timestamp_tz to assert each parsed result independently against its known expected timestamp value, in addition to comparing three-argument and two-argument calls. Preserve coverage of the empty nlsparam behavior while preventing identical regressions in both call paths from passing unnoticed.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@contrib/ivorysql_ora/sql/datatype_and_func_bugs.sql`:
- Around line 5-19: Update the two timestamp regression checks around
sys.to_timestamp and sys.to_timestamp_tz to assert each parsed result
independently against its known expected timestamp value, in addition to
comparing three-argument and two-argument calls. Preserve coverage of the empty
nlsparam behavior while preventing identical regressions in both call paths from
passing unnoticed.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: ada5a490-c865-432f-9c2a-0156eaf5b4c4
📒 Files selected for processing (3)
contrib/ivorysql_ora/expected/datatype_and_func_bugs.outcontrib/ivorysql_ora/sql/datatype_and_func_bugs.sqlcontrib/ivorysql_ora/src/builtin_functions/datetime_datatype_functions.c
🚧 Files skipped from review as they are similar to previous changes (2)
- contrib/ivorysql_ora/expected/datatype_and_func_bugs.out
- contrib/ivorysql_ora/src/builtin_functions/datetime_datatype_functions.c
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Summary
uintptr_tMotivation
Related to #1221 and #1386.
Switching the Clang job to
make COPT="-Werror"exposed existing Clang 18 diagnostics:-Wsometimes-uninitialized-Wvoid-pointer-to-enum-cast-Wenum-conversionThe timestamp change fixes the actual uninitialized path instead of suppressing the warning. The remaining changes document existing representation conversions without changing their logic.
Validation
CC=clang-18 CXX=clang++-18 ./configure --enable-nls ...make -j2 COPT="-Werror"- passedd60a5eadf84144443fe6608f44071fc7ff04903f- all 7 checks passed:buildmeson_buildpg_regressionoracle_regressionoracle_pg_regressioncontrib_regressionpolicySummary by CodeRabbit
Bug Fixes
TO_TIMESTAMPandTO_TIMESTAMP_TZreturn consistent results whether the optional NLS parameter is omitted or explicitly empty.Tests