Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Uninitialized variable being used in allocator_traits.inl #1206

Closed
mikoro opened this issue Jun 29, 2020 · 1 comment
Closed

Uninitialized variable being used in allocator_traits.inl #1206

mikoro opened this issue Jun 29, 2020 · 1 comment

Comments

@mikoro
Copy link

mikoro commented Jun 29, 2020

CUDA 11 RC, Microsoft Visual Studio Community 2019 Version 16.5.4

When compiling I get this warning:
thrust\detail\allocator\allocator_traits.inl(251): warning C4700: uninitialized local variable 'result' used

When running in debug mode I get this runtime error in allocator_traits.inl(251):
Run-Time Check Failure #3 - The variable 'result' is being used without being initialized.

I fixed by changing line 250 from:
typename allocator_system<Alloc>::type result;
to
typename allocator_system<Alloc>::type result {};

@alliepiper
Copy link
Collaborator

This was fixed by #1009.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants