Thread: Meaning of Code Lines

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    83

    Meaning of Code Lines

    Dear All,
    While analysing project code..i am not able to understand following peace of code..code any body help me out this?

    Code:
    #ifdef QAC
    #pragma PRQA_MESSAGES_OFF 3409, 3410
    #endif

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    #ifdef XX
    checks if there is a macro defined with the name XX. I would expect that QAC is a "compiler defined macro".
    #pragma YYYY
    is a compiler specific instruction to the compiler. In this case, it looks like it's disabling some warning messages - but that would be something you need to look at the specific compiler to find out.

    #endif is the end of #if or #ifdef.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    Quote Originally Posted by matsp View Post
    #ifdef XX
    checks if there is a macro defined with the name XX. I would expect that QAC is a "compiler defined macro".

    --
    Mats
    Did you mean constant?
    Mainframe assembler programmer by trade. C coder when I can.

  4. #4
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    No, macro would be more correct.

    Code:
    #define FOO
    
    #ifdef FOO
    /* something */
    #endif
    You'd get that something.

  5. #5
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,834
    The OP may be asking what the general intent of the code is.

    It is designed to suppress the specified warning messages. You'd have to look up what the 3409 and 3410 messages talk about and why it would be OK to suppress such messages.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Your biggest project: how many lines have you written?
    By happyclown in forum A Brief History of Cprogramming.com
    Replies: 44
    Last Post: 04-29-2009, 07:30 AM
  2. Lines of code per day.
    By abachler in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 10-26-2007, 09:20 AM
  3. Replies: 7
    Last Post: 07-30-2005, 11:28 PM
  4. count only lines of code...
    By flightsimdude in forum C Programming
    Replies: 13
    Last Post: 09-23-2003, 07:08 PM
  5. What do these tow lines of code mean?
    By Gamma in forum C++ Programming
    Replies: 1
    Last Post: 04-25-2002, 04:30 PM