Skip to content

Fix -Wunused-parameter error in codegen#3798

Open
kai-ion wants to merge 4 commits intomainfrom
streams.dynamodb
Open

Fix -Wunused-parameter error in codegen#3798
kai-ion wants to merge 4 commits intomainfrom
streams.dynamodb

Conversation

@kai-ion
Copy link
Copy Markdown
Collaborator

@kai-ion kai-ion commented Apr 16, 2026

Issue #, if available:

Description of changes:
Fix -Wunused-parameter error in generated ClientConfiguration for services with no specific config

The LoadSpecificConfig codegen template produces an empty function body for services that don't match any conditional block (e.g. DynamoDB Streams), leaving inputProfileName unused. This fails compilation with -Werror.

Add AWS_UNREFERENCED_PARAM(inputProfileName) unconditionally to the template.

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…vices with no specific config

The LoadSpecificConfig codegen template produces an empty function body for
services that don't match any conditional block (e.g. DynamoDB Streams),
leaving inputProfileName unused. This fails compilation with -Werror.

Add AWS_UNREFERENCED_PARAM(inputProfileName) unconditionally to the template.
#end
void ${metadata.classNamePrefix}ClientConfiguration::Load${serviceNamespace}SpecificConfig(const Aws::String& inputProfileName)
{
AWS_UNREFERENCED_PARAM(inputProfileName);
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.

you put this regardless if it is used or not, for instance in S3 you will put AWS_UNREFERENCED_PARAM(inputProfileName); then immediately use it. you should only use this if its truly unused.

kai-ion added 3 commits April 16, 2026 15:59
…vices with no specific config

The LoadSpecificConfig codegen template produces an empty function body for
services that don't match any conditional block (e.g. DynamoDB Streams),
leaving inputProfileName unused. This fails compilation with -Werror.

Add AWS_UNREFERENCED_PARAM(inputProfileName) unconditionally to the template.
…vices with no specific config

The LoadSpecificConfig codegen template produces an empty function body for
services that don't match any conditional block (e.g. DynamoDB Streams),
leaving inputProfileName unused. This fails compilation with -Werror.

Add AWS_UNREFERENCED_PARAM(inputProfileName) unconditionally to the template.
…vices with no specific config

The LoadSpecificConfig codegen template produces an empty function body for
services that don't match any conditional block (e.g. DynamoDB Streams),
leaving inputProfileName unused. This fails compilation with -Werror.

Add AWS_UNREFERENCED_PARAM(inputProfileName) unconditionally to the template.
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.

2 participants