Skip to content

misc(native): Minor warning fixes#27102

Merged
amitkdutta merged 1 commit intoprestodb:masterfrom
amitkdutta:export-D92586871
Feb 7, 2026
Merged

misc(native): Minor warning fixes#27102
amitkdutta merged 1 commit intoprestodb:masterfrom
amitkdutta:export-D92586871

Conversation

@amitkdutta
Copy link
Copy Markdown
Contributor

@amitkdutta amitkdutta commented Feb 7, 2026

Summary:
Fix warnings identified by clang-tidy in the presto_cpp http/ directory:

  • Replace C-style cast with static_cast in HttpClient.cpp (HttpResponse::consumeBody)
  • Remove C-style (void) parameter declarations in InternalAuthenticationFilter (use empty parens instead)
  • Comment out unused parameters in AbstractRequestHandler (onUpgrade, onError) and StatsFilterFactory (onRequest) to suppress -Wunused-parameter warnings
== NO RELEASE NOTE ==

Summary by Sourcery

Resolve clang-tidy and compiler warnings in the native HTTP components.

Bug Fixes:

  • Fix potential type-safety issue in HttpResponse body consumption by replacing a C-style cast with a C++ static_cast.
  • Suppress unused-parameter warnings in HTTP request handlers and filters by marking parameters as intentionally unused.
  • Modernize InternalAuthenticationFilter method declarations by removing legacy C-style void parameter lists to satisfy lint checks.

Summary:
Fix lint warnings identified by clang-tidy in the presto_cpp http/ directory:

- Replace C-style cast with static_cast in HttpClient.cpp (HttpResponse::consumeBody)
- Remove C-style `(void)` parameter declarations in InternalAuthenticationFilter (use empty parens instead)
- Comment out unused parameters in AbstractRequestHandler (onUpgrade, onError) and StatsFilterFactory (onRequest) to suppress -Wunused-parameter warnings

Differential Revision: D92586871
@amitkdutta amitkdutta requested review from a team as code owners February 7, 2026 02:19
@prestodb-ci prestodb-ci added the from:Meta PR from Meta label Feb 7, 2026
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Feb 7, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR addresses minor clang-tidy and compiler warnings in the presto_cpp HTTP stack by replacing a C-style cast with static_cast, removing obsolete C-style void parameter declarations, and annotating intentionally unused parameters to suppress -Wunused-parameter warnings without changing runtime behavior.

File-Level Changes

Change Details Files
Annotate unused HTTP server handler parameters to silence -Wunused-parameter without altering behavior.
  • Change AbstractRequestHandler::onUpgrade to name the parameter as a commented identifier to mark it unused.
  • Change AbstractRequestHandler::onError to name the parameter as a commented identifier to mark it unused while keeping the body unchanged.
presto-native-execution/presto_cpp/main/http/HttpServer.h
Modernize InternalAuthenticationFilter method declarations by removing C-style void parameter lists and keeping definitions consistent.
  • Update InternalAuthenticationFilter::sendGenericErrorResponse declaration to use empty parameter list instead of (void).
  • Update InternalAuthenticationFilter::sendUnauthorizedResponse declaration to use empty parameter list instead of (void).
  • Update InternalAuthenticationFilter::sendGenericErrorResponse definition to match the header declaration’s empty parameter list.
presto-native-execution/presto_cpp/main/http/filters/InternalAuthenticationFilter.h
presto-native-execution/presto_cpp/main/http/filters/InternalAuthenticationFilter.cpp
Replace C-style cast in HttpResponse::consumeBody with a type-safe static_cast.
  • Change pointer increment in HttpResponse::consumeBody from a C-style cast (char*)curr to static_cast<char*>(curr) to satisfy clang-tidy and improve type safety.
presto-native-execution/presto_cpp/main/http/HttpClient.cpp
Mark unused parameter in StatsFilterFactory::onRequest to avoid unused-parameter warnings.
  • Change StatsFilterFactory::onRequest parameter list to comment out the HTTPMessage* parameter name while keeping the implementation identical.
presto-native-execution/presto_cpp/main/http/filters/StatsFilter.h

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@amitkdutta amitkdutta changed the title misc(native): Minor warnings fixes misc(native): Minor warning fixes Feb 7, 2026
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

@aditi-pandit aditi-pandit left a comment

Choose a reason for hiding this comment

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

Thanks @amitkdutta

Copy link
Copy Markdown
Contributor

@aditi-pandit aditi-pandit left a comment

Choose a reason for hiding this comment

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

Thanks @amitkdutta

@amitkdutta amitkdutta merged commit 1efbb75 into prestodb:master Feb 7, 2026
155 of 167 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants