Advertisement
fsb4000

nvidia answer

Jul 20th, 2021
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. Hi Igor,
  2. After checking on our local , we think this is a MSFT cl.exe bug .
  3.  
  4. 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 .
  5.  
  6. See below steps
  7.  
  8. $ type test.cpp
  9. #define _CRT_STRINGIZE_(x) #x
  10. #define _CRT_STRINGIZE(x) _CRT_STRINGIZE_(x)
  11.  
  12. #define _WARNING_MESSAGE(NUMBER, MESSAGE) __FILE__ "(" _CRT_STRINGIZE(__LINE__) "): warning " NUMBER ": " MESSAGE
  13. #pragma message(\
  14. _WARNING_MESSAGE("Ok? STL4033", "The contents of are available only with C++20 or later or /await:strict."))
  15.  
  16. #pragma message(_WARNING_MESSAGE( \
  17. "Bad STL4033", "The contents of are available only with C++20 or later or /await:strict."))
  18.  
  19. #pragma message(_WARNING_MESSAGE( "Okay STL4033", "The contents of are available only with C++20 or later or /await:strict."))
  20. After preprocessing:
  21.  
  22. $ cl -E -nologo test.cpp > test.i
  23. test.cpp
  24. #line 1 "test.cpp"
  25.  
  26. #pragma message(\
  27. "test.cpp" "(" "6" "): warning " "Bad? STL4033" ": " "The contents of are available only with C++20 or later or /await:strict.")
  28.  
  29. #pragma message(
  30. "test.cpp" "(" "9" "): warning " "Bad STL4033" ": " "The contents of are available only with C++20 or later or /await:strict.")
  31.  
  32. #pragma message("test.cpp" "(" "11" "): warning " "Okay STL4033" ": " "The contents of are available only with C++20 or later or /await:strict.")
  33.  
  34. The highlighted lines are not well-formed input to CL.exe:
  35.  
  36. cl /TP -nologo -c test.i
  37. test.i
  38. test.cpp(6): warning Ok? STL4033: The contents of are available only with C++20 or later or /await:strict.
  39. test.cpp(8): warning C4081: expected 'string'; found 'newline'
  40. test.cpp(9): error C2059: syntax error: 'string'
  41. test.cpp(9): error C2059: syntax error: ')'
  42. test.cpp(11): warning Okay STL4033: The contents of are available only with C++20 or later or /await:strict.
  43.  
  44. 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 .
  45.  
  46. Hope this explains your concern . Let me know if you have extra questions .
  47. Best,
  48. Yuki
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement