Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uninitialised variable in sox/utils.cpp #1306

Merged
merged 1 commit into from Feb 23, 2021

Conversation

fmassa
Copy link
Member

@fmassa fmassa commented Feb 23, 2021

When compiling torchaudio with -Werror,-Wuninitialized, we would get compilation errors due to dummy not being initialized as follows.

 pytorch/audio/torchaudio/csrc/sox/utils.cpp:179:53: error: variable 'dummy' is uninitialized when used here [-Werror,-Wuninitialized]
      ptr[i] = SOX_SAMPLE_TO_FLOAT_32BIT(buffer[i], dummy);

This PR fixes it by initializing it to zero.

@fmassa fmassa changed the title Fix initialised variable Fix uninitialised variable Feb 23, 2021
@fmassa fmassa changed the title Fix uninitialised variable Fix uninitialised variable in sox/utils.cpp Feb 23, 2021
Copy link
Collaborator

@mthrok mthrok left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks!

@mthrok mthrok merged commit 3a055b5 into pytorch:master Feb 23, 2021
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.

None yet

3 participants