Skip to content

Fix signedness and shadow diagnostics in common code - #2391

Open
reshke wants to merge 1 commit into
apache:mainfrom
reshke:fix-compiler-warnings-common-types
Open

reshke wants to merge 1 commit into
apache:mainfrom
reshke:fix-compiler-warnings-common-types

Conversation

@reshke

@reshke reshke commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

GCC examples: config_info.c:198:18 compared int with size_t, encnames.c:594:33 compared int with pg_enc, file_utils.c:517:51 compared size_t with ssize_t (-Wsign-compare); GCC 14 also reported controldata_utils.c:52:29 parameter DataDir shadowing a global (-Wshadow). Keep length types consistent and rename the shadowing parameters.

Fixes #ISSUE_Number

What does this PR do?

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

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


@Alena0704 Alena0704 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

GCC examples: config_info.c:198:18 compared int with size_t, encnames.c:594:33 compared int with pg_enc, file_utils.c:517:51 compared size_t with ssize_t (-Wsign-compare); GCC 14 also reported controldata_utils.c:52:29 parameter DataDir shadowing a global (-Wshadow). Keep length types consistent and rename the shadowing parameters.
@reshke
reshke force-pushed the fix-compiler-warnings-common-types branch from 3b349a3 to c09a0ef Compare November 23, 2026 08:58
@x4m

x4m commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Wouldn't it be better to just sync with Postgres here?
I don't feel confident reviewing cryptography, even it's just an "obvious" signedness.

Comment thread src/common/hmac.c
* to shrink it down.
*/
if (len > block_size)
if (len > (size_t) block_size)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change and the other one in SASL is either pointless or scary. I just can't figure out which one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants