about the #pragma

Discussion in 'C Programming' started by rwen2012@gmail.com, Jun 8, 2006.

  1. Guest

    Hi, guys,

    I am confused with the preprocessor instruction #pragma.

    What does the #pragma mean?
    and what does this mean as follow?

    ====================
    #pragma intterupt Timer
    ====================

    any reply is appreciated.
     
    , Jun 8, 2006
    #1
    1. Advertising

  2. "" wrote:
    >
    > Hi, guys,
    >
    > I am confused with the preprocessor instruction #pragma.
    >
    > What does the #pragma mean?
    > and what does this mean as follow?
    >
    > ====================
    > #pragma intterupt Timer
    > ====================

    [...]

    Pragmas are, by definition, implementation defined. They basically
    say "hey, compiler, do something special here". What that "something"
    is is entirely up to the compiler.

    As to what your particular pragma does, you would have to check the
    documentation for the particular compiler that was used to compile
    the code.

    --
    +-------------------------+--------------------+-----------------------+
    | Kenneth J. Brody | www.hvcomputer.com | #include |
    | kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
    +-------------------------+--------------------+-----------------------+
    Don't e-mail me at: <mailto:>
     
    Kenneth Brody, Jun 8, 2006
    #2
    1. Advertising

  3. "" <> writes:
    > Hi, guys,
    >
    > I am confused with the preprocessor instruction #pragma.
    >
    > What does the #pragma mean?
    > and what does this mean as follow?
    >
    > ====================
    > #pragma intterupt Timer
    > ====================
    >
    > any reply is appreciated.


    You posted the same article twice. Google seems to encourage this for
    some reason.

    A #pragma directive "causes the implementation to behave in an
    implementation-defined manner" (except for a few of the form
    "#pragma STDC ..."that are defined by C99). You'll have to consult
    the documentation for your compiler to find out what "#pragma interrupt"
    means.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, Jun 8, 2006
    #3
  4. Default User Guest

    wrote:

    > Hi, guys,
    >
    > I am confused with the preprocessor instruction #pragma.
    >
    > What does the #pragma mean?
    > and what does this mean as follow?
    >
    > ====================
    > #pragma intterupt Timer
    > ====================
    >
    > any reply is appreciated.



    Except for a few pragmas defined in the 1999 standard, almost anything
    used with the #pragma directive is platform-specific and questions
    should be directed to a newsgroup dedicated to that platform. I don't
    know what compiler you are using, but a newsgroup for it is the place
    to ask.



    Brian
     
    Default User, Jun 8, 2006
    #4
  5. Keith Thompson <> wrote:
    >"" <> writes:
    >> What does the #pragma mean?
    >> and what does this mean as follow?
    >> ====================
    >> #pragma intterupt Timer
    >> ====================

    >
    >A #pragma directive "causes the implementation to behave in an
    >implementation-defined manner" (except for a few of the form
    >"#pragma STDC ..."that are defined by C99). You'll have to consult
    >the documentation for your compiler to find out what "#pragma interrupt"
    >means.


    A function called as an ISR (interrupt service routine) may be called
    at any time, in the middle of the execution of other functions.
    To ensure that the original interrupted code can continue executing,
    in most cases the interrupt pragma modifies the entry/exit code the
    compiler will generate for a function, making it save (and restore on
    exit) additional information about the processor state. It could save
    more registers, floating point processor state, temporarily disable
    interrupts, etc.
    The details will change from system to system. As Keith wrote, only
    the documentation for your compiler/environment will provide you with
    more information.
     
    Roberto Waltman, Jun 8, 2006
    #5
  6. Guest

    thank you all very much,
    after read these, I have got the main idea of what the #pragma means.

    thanks a lot!

    Rwen.
     
    , Jun 9, 2006
    #6
  7. Nelu Guest

    <> wrote:
    > thank you all very much,
    > after read these, I have got the main idea of what the #pragma means.
    >


    Please quote some context when replying.

    Thank you.

    --
    Ioan - Ciprian Tandau
    tandau _at_ freeshell _dot_ org (hope it's not too late)
    (... and that it still works...)
     
    Nelu, Jun 9, 2006
    #7
  8. santosh Guest

    Keith Thompson wrote:
    > "" <> writes:
    > > Hi, guys,
    > >
    > > I am confused with the preprocessor instruction #pragma.
    > >
    > > What does the #pragma mean?
    > > and what does this mean as follow?
    > >
    > > ====================
    > > #pragma intterupt Timer
    > > ====================
    > >
    > > any reply is appreciated.

    >
    > You posted the same article twice. Google seems to encourage this for some reason.


    Well, my posts to this group are currently over 400 and I've yet to
    make a double/multiple post. AFAICS, it's not Google's fault, rather
    it's the poster. Though currently I use an ADSL connection, I've used a
    56K dial-up modem for many years. Often, it's so slow, that you might
    get tempted to press the 'reply' button twice, thinking the site has
    stalled.

    Of course, there're also people who post multiple times, simply to get
    a rise out the group. They may come from a web forum background, which
    are much more lax on posting discipline.
     
    santosh, Jun 10, 2006
    #8
  9. Default User Guest

    santosh wrote:

    > Keith Thompson wrote:


    > > You posted the same article twice. Google seems to encourage this
    > > for some reason.

    >
    > Well, my posts to this group are currently over 400 and I've yet to
    > make a double/multiple post. AFAICS, it's not Google's fault, rather
    > it's the poster.


    This is not true, it's just that you've been lucky not to encounter the
    problem. Sometimes Google will report that there was an error and the
    message couldn't be sent, but in fact it has. It happens. It happened
    to me when I used Google last year.



    Brian
    --
    If televison's a babysitter, the Internet is a drunk librarian who
    won't shut up.
    -- Dorothy Gambrell (http://catandgirl.com)
     
    Default User, Jun 10, 2006
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    9
    Views:
    14,332
    Rob Dekker
    Jul 21, 2005
  2. ryang
    Replies:
    1
    Views:
    987
    Wes Groleau
    Apr 11, 2005
  3. Titus A Ducksass
    Replies:
    1
    Views:
    6,056
    Sid Ismail
    Aug 1, 2003
  4. Paul J. Le Genial

    [Q] pragma no-cache : what about the images ?

    Paul J. Le Genial, Mar 14, 2005, in forum: HTML
    Replies:
    5
    Views:
    7,534
  5. Denis Lagno

    Re: pragma

    Denis Lagno, Oct 4, 2003, in forum: C++
    Replies:
    0
    Views:
    429
    Denis Lagno
    Oct 4, 2003
Loading...

Share This Page