Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hi Igor,
- After checking on our local , we think this is a MSFT cl.exe bug .
- nvcc will launch cl -E first before compiling . But in your case , cl -E doesn't process the "\" in macro well and leads to the failure .
- See below steps
- $ type test.cpp
- #define _CRT_STRINGIZE_(x) #x
- #define _CRT_STRINGIZE(x) _CRT_STRINGIZE_(x)
- #define _WARNING_MESSAGE(NUMBER, MESSAGE) __FILE__ "(" _CRT_STRINGIZE(__LINE__) "): warning " NUMBER ": " MESSAGE
- #pragma message(\
- _WARNING_MESSAGE("Ok? STL4033", "The contents of are available only with C++20 or later or /await:strict."))
- #pragma message(_WARNING_MESSAGE( \
- "Bad STL4033", "The contents of are available only with C++20 or later or /await:strict."))
- #pragma message(_WARNING_MESSAGE( "Okay STL4033", "The contents of are available only with C++20 or later or /await:strict."))
- After preprocessing:
- $ cl -E -nologo test.cpp > test.i
- test.cpp
- #line 1 "test.cpp"
- #pragma message(\
- "test.cpp" "(" "6" "): warning " "Bad? STL4033" ": " "The contents of are available only with C++20 or later or /await:strict.")
- #pragma message(
- "test.cpp" "(" "9" "): warning " "Bad STL4033" ": " "The contents of are available only with C++20 or later or /await:strict.")
- #pragma message("test.cpp" "(" "11" "): warning " "Okay STL4033" ": " "The contents of are available only with C++20 or later or /await:strict.")
- The highlighted lines are not well-formed input to CL.exe:
- cl /TP -nologo -c test.i
- test.i
- test.cpp(6): warning Ok? STL4033: The contents of are available only with C++20 or later or /await:strict.
- test.cpp(8): warning C4081: expected 'string'; found 'newline'
- test.cpp(9): error C2059: syntax error: 'string'
- test.cpp(9): error C2059: syntax error: ')'
- test.cpp(11): warning Okay STL4033: The contents of are available only with C++20 or later or /await:strict.
- Please reach out to MSFT directly is this is urgent to you and also we will try to contact them as well . The workaround you found is right .
- Hope this explains your concern . Let me know if you have extra questions .
- Best,
- Yuki
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement