Xcode Warning: "/ * in block comment"

I really like to temporarily enable and disable parts of the code, commenting them as follows:

/*
some code
/**/

(remember

/ ** /

instead

* /

in the end)

However, Xcode continues to warn:

/* within block comment

Is there a way to "specifically disable" specific warnings?

Why? I will tell you why: Because I can easily accept it and exit with just one character, without having to scroll down the block to take "* / in and out.

+5
source share
3 answers

I found a very nice alternative:

/*    
some code
/**/

You can simply use this option:

/*
some code
//*/

to achieve the same goal without Xcode warnings!

+5
source

When I want to temporarily remove a block of code, I use:

#if 0
somecode();
#endif

.

, 0 1:

#if 1
somecode();
#endif

, / , , :

#define SOME_FANCY_FEATURE 1

...

#if SOME_FANCY_FEATURE
somecode();
#endif // SOME_FANCY_FEATURE
+8

The real answer for me (just turn off the Xcode warning without changing a single line in the legacy code): fooobar.com/questions/1144944 / ...
Apple LLVM 6.0 Custom compiler flags → Other warning flags → -Wno-comment

+3
source

All Articles