CUDA: NVCC gives controlling expression is constant warning on assert

前端 未结 5 1899
小鲜肉
小鲜肉 2021-01-18 14:09

I get the warning controlling expression is constant on assert statement like this:

assert(... && \"error message\");

5条回答
  •  孤街浪徒
    2021-01-18 15:02

    If it is LLVM based, then you can use something like this:

    #pragma clang diagnostic push
    #pragma clang diagnostic ignored "-Wmultichar"
    
    char b = 'df'; // no warning.
    
    #pragma clang diagnostic pop
    

    From Controlling Diagnostics via Pragmas.

提交回复
热议问题