Skip to content

Conversation

@StephanTLavavej
Copy link
Member

@StephanTLavavej StephanTLavavej commented May 1, 2020

<random>
This was defining a doubly-nested struct _Noinit, shadowing the STL-wide machinery that we should have been using:

STL/stl/inc/yvals.h

Lines 311 to 313 in f0f0b55

enum _Uninitialized { // tag for suppressing initialization
_Noinit
};

<istream>
Rename bool _Noinit to _Skip_init, avoiding more shadowing.

<yvals_core.h>
CUDA 9.2 was activating __has_cpp_attribute(msvc::known_semantics) yet emitting warning: attribute namespace "msvc" is unrecognized. I've added a TRANSITION workaround.

<memory>
We were unconditionally using __declspec(empty_bases), causing CUDA 9.2 to emit error: unknown attribute "empty_bases". @CaseyCarter noticed that this had no effect (only one base can possibly be empty here), so we can simply remove __declspec(empty_bases). (These control blocks are new to VS 2019 16.7, so this is extra safe.)

<string>
CUDA 9.2 was emitting a valid warning: pointless comparison of unsigned integer with zero. Because it doesn't support if constexpr, I've added a separate function, marked TRANSITION. Note for the perceptive: I left // can hold -2^63 and 2^64 - 1, plus NUL unchanged in the original function so we can restore it easily.

<xlocmon>
CUDA 9.2 noticed bogus code here - we static_cast<size_t> the int return value of sprintf_s, so if (_Count < 0) was always false!

<xutility>
CUDA 9.2 correctly complained about unreachable code here. I've adjusted the preprocessor/control flow to be simpler. This is a permanent improvement, not TRANSITION.

<xstring>
Unwrap two comments.

<xlocmon>
<xlocnum>
Avoid &_Src[sizeof(_Src)] and &_Buf[_Count]. (The former technically performs a forbidden dereferencing; the latter can too, depending on the value of _Count.) I considered using _Src, _Src + sizeof(_Src), but figured the throughput/debug codegen of begin/end was acceptable in iostreams.

@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label May 1, 2020
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner May 1, 2020 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Something can be improved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants