Skip to content

Commit e681cdd

Browse files
crafcat7xiaoxiang781216
authored andcommitted
osperf.c:fix warning maybe-uninitialized
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]>
1 parent 4d5536b commit e681cdd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

benchmarks/osperf/osperf.c

+1
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ static size_t hpwork_performance(void)
237237
(FAR void *)&result
238238
};
239239

240+
memset(&result, 0, sizeof(result));
240241
memset(&work, 0, sizeof(work));
241242
performance_start(&result);
242243
ret = work_queue(HPWORK, &work, work_handle, args, 0);

0 commit comments

Comments
 (0)