473,385 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

volatile qualified parameters

Hello,
I have a question: when do we use volatile
qualified function parameters?

Vijay
Nov 14 '05 #1
1 2048
In article <2h************@uni-berlin.de>,
"Vijay Kumar R Zanvar" <vi*****@globaledgesoft.com> wrote:
Hello,
I have a question: when do we use volatile
qualified function parameters?


When we want to confuse the reader.

Seriously, if you intend to modify a function parameter or any other
local variable of a function between a call to setjmp and a
corresponding call to longjmp then you must make that function parameter
or local variable volatile in order to avoid undefined behavior. You
shouldn't use volatile qualification in the function declaration because
it is just plain pointless and only confusing (qualifiers like volatile
or const are just ignored at that point), but only in the implementation
of the function.

And if you use this as an answer to your homework, then everyone will
know that you didn't write it yourself :-)
Nov 14 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Mantorok Redgormor | last post by:
does volatile really inhibit side effects? that is the rules for sequence points and side effects do not apply to volatile objects? -- nethlek
7
by: r_o_h_i_t | last post by:
Can anybody please tell me the complete properties if volatile variables in C. And what are specific uses of them? Thanks in advance.
14
by: John Temples | last post by:
Given this code: extern volatile unsigned char v; int main(void) { v; return 0; }
14
by: Ian Pilcher | last post by:
It's pretty common to see declarations such as: static volatile sig_atomic_t caught_signal = 0; C99 defines sig_atomic_t as a "... (possibly volatile-qualified) integer type of an object that...
14
by: google-newsgroups | last post by:
Hello, even (or because?) reading the standard (ISO/IEC 9899/1999) I do not understand some issues with volatile. The background is embedded programming where data is exchanged between main...
17
by: dingoatemydonut | last post by:
The C99 standard states: "In the abstract machine, all expressions are evaluated as specified by the semantics. An actual implementation need not evaluate part of an expression if it can deduce...
18
by: Mark | last post by:
Hi List, I want to write a function to copy some data out of a hardware buffer. The hardware can change the contents of this buffer without it being written to by my function. I want to use...
6
by: red floyd | last post by:
I have a struct that maps onto a set of memory mapped registers. I access this via a pointer. Is it better to declare it as pointer to a volatile struct, or to declare the individual members as...
3
by: Rakesh Kumar | last post by:
Hi - I am actually trying to get my feet in multi-threaded C++ programming. While I am aware that the C++ standard does not talk about threads (at least, for now - in C++03) - my question is more...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.