c++ - CUDA: NVCC gives controlling expression is constant warning on assert -


i warning controlling expression constant on assert statement this:

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

why warning on assert? how can suppress warning?

nvcc nvidia cuda compiler, think based on llvm. why give warning, when same compiles fine gcc or visual c++ compilers?

a portable alternative (possibly wrapped in macro) like:

 {      const bool error_message = true;      assert([...] && error_message);  } 

to clear meant:

#define myassert(msg, exp) { const bool msg(true); assert(msg && (exp)); } // usage: myassert(ouch, && b); 

... gives e.g.:

assertion "ouch && (a && b)" failed [...]


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -