Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > about the #pragma

Reply
Thread Tools

about the #pragma

 
 
rwen2012@gmail.com
Guest
Posts: n/a
 
      06-08-2006
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.

 
Reply With Quote
 
 
 
 
Kenneth Brody
Guest
Posts: n/a
 
      06-08-2006
"(E-Mail Removed)" 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: <(E-Mail Removed)>

 
Reply With Quote
 
 
 
 
Keith Thompson
Guest
Posts: n/a
 
      06-08-2006
"(E-Mail Removed)" <(E-Mail Removed)> 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.velocityreviews.com/forums/(E-Mail Removed) <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.
 
Reply With Quote
 
Default User
Guest
Posts: n/a
 
      06-08-2006
(E-Mail Removed) 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
 
Reply With Quote
 
Roberto Waltman
Guest
Posts: n/a
 
      06-08-2006
Keith Thompson <(E-Mail Removed)> wrote:
>"(E-Mail Removed)" <(E-Mail Removed)> 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.
 
Reply With Quote
 
rwen2012@gmail.com
Guest
Posts: n/a
 
      06-09-2006
thank you all very much,
after read these, I have got the main idea of what the #pragma means.

thanks a lot!

Rwen.

 
Reply With Quote
 
Nelu
Guest
Posts: n/a
 
      06-09-2006
(E-Mail Removed) <(E-Mail Removed)> 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...)
 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      06-10-2006
Keith Thompson wrote:
> "(E-Mail Removed)" <(E-Mail Removed)> 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.

 
Reply With Quote
 
Default User
Guest
Posts: n/a
 
      06-10-2006
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)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments