Meaning of Code Lines

This is a discussion on Meaning of Code Lines within the C Programming forums, part of the General Programming Boards category; Dear All, While analysing project code..i am not able to understand following peace of code..code any body help me out ...

  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
    Katy, Texas
    Posts
    2,309
    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?
    Mac and Windows cross platform programmer. Ruby lover.

    Quote of the Day
    12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong.

    Amen brother!

  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,832
    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, 08: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, 10:20 AM
  3. Replies: 7
    Last Post: 07-31-2005, 12:28 AM
  4. count only lines of code...
    By flightsimdude in forum C Programming
    Replies: 13
    Last Post: 09-23-2003, 08:08 PM
  5. What do these tow lines of code mean?
    By Gamma in forum C++ Programming
    Replies: 1
    Last Post: 04-25-2002, 05:30 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21