Skip to content

Reduce Optimization Warnings - #132

Open
Lightning11wins wants to merge 24 commits into
masterfrom
reduce-optimization-warnings
Open

Reduce Optimization Warnings#132
Lightning11wins wants to merge 24 commits into
masterfrom
reduce-optimization-warnings

Conversation

@Lightning11wins

@Lightning11wins Lightning11wins commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Reduce more warnings that only occur when --enable-optimization is used. Some of these warning fixes also fix minor bugs and improve hardening.

GitHub Relationships

These will need to be reviewed and merged into master before this PR is reviewed.

@Lightning11wins Lightning11wins self-assigned this Jul 24, 2026
@Lightning11wins Lightning11wins added the size: trivial Easy to review, probably ~100 lines or fewer. label Jul 24, 2026
@Lightning11wins
Lightning11wins marked this pull request as draft July 24, 2026 20:20
@Lightning11wins

Copy link
Copy Markdown
Contributor Author

I haven't fixed all the warnings yet. I'll mark this as ready for review once more of them are resolved.

@Lightning11wins Lightning11wins added the ai-review Request AI review for PRs. label Jul 31, 2026
@Lightning11wins

Copy link
Copy Markdown
Contributor Author

I finished resolving all the warnings when passing --enable-optimization.

@Lightning11wins
Lightning11wins marked this pull request as ready for review July 31, 2026 21:20
@Lightning11wins Lightning11wins added ai-review Request AI review for PRs. and removed ai-review Request AI review for PRs. labels Jul 31, 2026
@Lightning11wins

Copy link
Copy Markdown
Contributor Author

@greptileai Please review.

@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR reduces optimization-build warnings and hardens several previously undefined or unchecked paths.

  • Adds explicit initialization, const-correctness, pointer casts, and unsupported-value guards across runtime and test code.
  • Fixes credential-list allocation and cleanup handling, propagates widget-layout errors, and validates unsupported hashing and data types.
  • Removes unused variables and obsolete code from HTML rendering, query, networking, reporting, utility, and test modules.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code regression identified.

The behavior-affecting changes add error propagation, initialization, bounds handling, and cleanup safeguards, while the remaining edits are warning-oriented type corrections or removal of unused state.

Important Files Changed

Filename Overview
centrallix/cxss/cxss_credentials_db.c Initializes credential-list state, checks allocation and SQLite binding failures, and safely cleans up partial results.
centrallix/expression/exp_functions.c Rejects unsupported hash algorithms and initializes aggregate evaluation status before use.
centrallix/objectsystem/obj_datatypes.c Bounds money fractional formatting and reports malformed fractional values without changing valid-value behavior.
centrallix/wgtr/apos.c Propagates recursive layout failures and removes unused bookkeeping while preserving layout side effects.
centrallix-lib/src/mtask.c Locally suppresses intentional uninitialized-stack warnings required by the green-thread stack setup.
centrallix/utility/json_util.c Removes unused datetime-presence tracking while retaining parsing and accepted-field behavior.

Reviews (1): Last reviewed commit: "Add comments to make dead code explicit." | Re-trigger Greptile

@Lightning11wins

Copy link
Copy Markdown
Contributor Author

This PR is cleared for human review.

@greptile-apps

greptile-apps Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review (136 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

@dpulls

dpulls Bot commented Aug 21, 2026

Copy link
Copy Markdown

🎉 All dependencies have been resolved !

@gbeeley

gbeeley commented Aug 21, 2026

Copy link
Copy Markdown
Member

Is there a way to refresh this PR so it doesn't show those 114 or so changed files from PR #95 which has already been merged?

@Lightning11wins

Copy link
Copy Markdown
Contributor Author

Yup, turns out merging master fixes it.

@Lightning11wins

Copy link
Copy Markdown
Contributor Author

I conducted my own review and fixed several bugs. This PR looks fully ready to merge.

@gbeeley gbeeley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix needed for modulus clamping of fraction_part.

}

/** Clamp the cents to the low four digits **/
fraction_part = m->FractionPart % 10000;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be better resolved once we merge the MoneyType representation PR, but I think this change makes the problem worse, though the warning message helps. It prevents weird output from a malformed MoneyType value, but it does so by hiding the malformed data and making it look like everything's okay. It'd be better to either have it print a malformed value weirdly, fold the out of range fraction_part into the integer_part, or else to return an error. The latter may be best here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, switching to returning an error.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@Lightning11wins
Lightning11wins requested review from gbeeley and removed request for nboard August 28, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request AI review for PRs. size: trivial Easy to review, probably ~100 lines or fewer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants