Nested comments no longer allowed Changed behaviour in 2.2 beta

This may simply show up my sloppy programming skills, but the behaviour of nested comments has changed between 2.1 and the 2.2 beta. I’m used to using /*/ to start and end multi-line comments but in 2.2. this raises a warning.

line 1 //
line 2 Multi-line comment
line 3 goes here
line 4 /

I get a warning on line 4 “warning: nested comment is not allowed”.

Can this warning be disabled or should I give up bidirectional comments?

Hmm…I never even knew that you could write comments like that. I try to avoid multi-line comments inside the method body itself (I guess everyone has their own preferred way), but when I do, I always just do it like:


  • Comment here


I think that’s how Visual Studio formats it by default anyway though…

Visual Studio works fine and highlights comments in green using either method. It is the NVCC compiler throwing the warning.

I’d like to know if this warning is really dangerous and can safely be ignored with the version 2.2 NVCC compiler. NVCC 2.1 was quite happy with nested comments.