This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Compiler V2.40a #pragma warning disable = 329 doesn't work

Using the below pragma

#pragma warning disable = 329
does not suppress warning 329.

The warning is:
warning C329: single-line comment contains line-continuation

Parents
  • First off, a side remark: why use single-line comments for a half-page block comment?

    I thought that everything after the '//' comment was supposed to be ignored.

    Well, almost, but not quite everything. The technical details set aside, suffice it to say that processing of backslash-linebreak line continuation is done by the preprocessor before it interprets comment characters. I.e.

    //int foo = 42;
    
    does not define 'foo', because the whole snippet is just a single comment.

    Given that

    * it's considerably more likely that this happened by accident than on purpose
    * such an accident can hide valid code from the compiler, and
    * it's never actually necessary to do it like that

    I'd say the warning is justified, and shouldn't be turned off. So the fact that turning it off didn't work is a positive feature ;->

Reply
  • First off, a side remark: why use single-line comments for a half-page block comment?

    I thought that everything after the '//' comment was supposed to be ignored.

    Well, almost, but not quite everything. The technical details set aside, suffice it to say that processing of backslash-linebreak line continuation is done by the preprocessor before it interprets comment characters. I.e.

    //int foo = 42;
    
    does not define 'foo', because the whole snippet is just a single comment.

    Given that

    * it's considerably more likely that this happened by accident than on purpose
    * such an accident can hide valid code from the compiler, and
    * it's never actually necessary to do it like that

    I'd say the warning is justified, and shouldn't be turned off. So the fact that turning it off didn't work is a positive feature ;->

Children