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

benchmarks/osperf: fix warning maybe-uninitialized #3015

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

crafcat7
Copy link
Contributor

@crafcat7 crafcat7 commented Mar 5, 2025

Summary

Fix osperf build warning

In function 'performance_gettime',
    inlined from 'hpwork_performance' at osperf.c:245:10:
osperf.c:123:3: error: 'result.end' may be used uninitialized [-Werror=maybe-uninitialized]
  123 |   up_perf_convert(result->end - result->start, &ts);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
osperf.c: In function 'hpwork_performance':
osperf.c:228:29: note: 'result.end' was declared here
  228 |   struct performance_time_s result;
      |                             ^~~~~~
CC:  audio/lib_buffer.c
CC:  common/arm64_initialize.c
CC:  builtin/lib_builtin_getname.c

Impact

  • Build: fix warnings.
  • Runtime: initialize memory before use.

Testing

Local build success

Copy link
Contributor

@jerpelea jerpelea left a comment

Choose a reason for hiding this comment

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

please update title to
benchmarks/osperf: fix warning maybe-uninitialized

@jerpelea jerpelea changed the title ospert.c:fix warning maybe-uninitialized benchmarks/osperf: fix warning maybe-uninitialized Mar 5, 2025
Summary:
In function 'performance_gettime',
    inlined from 'hpwork_performance' at osperf.c:245:10:
osperf.c:123:3: error: 'result.end' may be used uninitialized [-Werror=maybe-uninitialized]
  123 |   up_perf_convert(result->end - result->start, &ts);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
osperf.c: In function 'hpwork_performance':
osperf.c:228:29: note: 'result.end' was declared here
  228 |   struct performance_time_s result;
      |                             ^~~~~~
CC:  audio/lib_buffer.c
CC:  common/arm64_initialize.c
CC:  builtin/lib_builtin_getname.c

Signed-off-by: chenrun1 <[email protected]>
@crafcat7
Copy link
Contributor Author

crafcat7 commented Mar 5, 2025

please update title to benchmarks/osperf: fix warning maybe-uninitialized

Done

Copy link

@cederom cederom left a comment

Choose a reason for hiding this comment

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

Thank you @crafcat7 :-)

@cederom cederom requested a review from xiaoxiang781216 March 5, 2025 15:58
@cederom cederom merged commit a7020e4 into apache:master Mar 5, 2025
37 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.

5 participants