473,395 Members | 2,192 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,395 software developers and data experts.

Use of __THROW in stdio.h

What purpose does __THROW serve in stdio.h. For example, in I see stuff
like the following in stdio.h:

/* Generate a temporary filename. */
extern char *tmpnam (char *__s) __THROW;
__END_NAMESPACE_STD

#ifdef __USE_MISC
/* This is the reentrant variant of `tmpnam'. The only difference is
that it does not allow S to be NULL. */
extern char *tmpnam_r (char *__s) __THROW;
#endif

I understand the include guards and that extern declares (but not
defines) a variable. I just am drawing a blank on what __THROW. Can
someone please enlighten me on this?

Thanks in advance
Chad

Jan 4 '06 #1
4 17020
Chad wrote:
What purpose does __THROW serve in stdio.h.
Ask the person who wrote it. It's not something specified by the C
standard beyond the fact that identifiers that begin with double
underscores are reserved for the implementation for whatever use
it likes.
For example, in I see stuff
like the following in stdio.h:
...


That may be what is in _your_ implementation's <stdio.h>, but it
is not required to be in anyone else's. Indeed, there is no requirement
that a file called stdio.h even exist.

Comp.lang.c doesn't deal with underlying implementation specifics. It
only
deals with what the minimal C language definition and the C virtual
machine.

I suggest you try a newsgroup dedicated to your implementation.

--
Peter

Jan 4 '06 #2

Chad wrote:
What purpose does __THROW serve in stdio.h. For example, in I see stuff
like the following in stdio.h:

/* Generate a temporary filename. */
extern char *tmpnam (char *__s) __THROW;
__END_NAMESPACE_STD

#ifdef __USE_MISC
/* This is the reentrant variant of `tmpnam'. The only difference is
that it does not allow S to be NULL. */
extern char *tmpnam_r (char *__s) __THROW;
#endif

I understand the include guards and that extern declares (but not
defines) a variable. I just am drawing a blank on what __THROW. Can
someone please enlighten me on this?


I checked mingw's stdio.h and there's no __THROW. My Linux box has it.
I think it's related to implementing ISO C stdio on top on C++
iostreams but I'm not sure so you should probably wait for someone else
to answer the question.

Jan 4 '06 #3
On 3 Jan 2006 19:02:01 -0800, "Chad" <cd*****@gmail.com> wrote:
What purpose does __THROW serve in stdio.h. For example, in I see stuff
like the following in stdio.h:

/* Generate a temporary filename. */
extern char *tmpnam (char *__s) __THROW;
__END_NAMESPACE_STD


This is a system-specific issue, and does not apply to C.

For reference, __THROW is meant to declare the function as capable of
throwing exceptions (a C++ feature). In C, the macro does nothing.

Jan 4 '06 #4

Raymond Martineau wrote:
On 3 Jan 2006 19:02:01 -0800, "Chad" <cd*****@gmail.com> wrote:
What purpose does __THROW serve in stdio.h. For example, in I see stuff
like the following in stdio.h:

/* Generate a temporary filename. */
extern char *tmpnam (char *__s) __THROW;
__END_NAMESPACE_STD


This is a system-specific issue, and does not apply to C.

For reference, __THROW is meant to declare the function as capable of
throwing exceptions (a C++ feature). In C, the macro does nothing.


Okay. Thanks. I wasn't aware _THROW was system-specific.

Chad

Jan 4 '06 #5

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

Similar topics

2
by: clusardi2k | last post by:
Hello, I'm trying to understand someone else code. The below compiles and works fine and dandy. #include <sys/types.h> #include "unistd.h" #include "stdio.h"
53
by: \(ProteanThread\) | last post by:
can "stdio.h" be OS specific at the kernal level or ? i know what I'm trying to ask here but not sure how to word it :-) -- Woodzy http://www.rtdos.com/forum
9
by: sunway | last post by:
i have written a small program, it turns out to be wrong, while(read()!=EOF){ read(); read(); read(); } so,when read==EOF,the next read() will read a -1, and the program will go infinitely.
11
by: talk | last post by:
hi,guy i have a question. are the functions in <stdio.h> system calls provided by operation system? if so, i want to know how C implements that we can call system calls by using the functions in...
2
by: david wolf | last post by:
My understanding is that cstdio basically is the same as stdio.h except the functions are in a namspace called std. However when I take a look at the content of the file cstdio, it has the...
4
by: Raman | last post by:
Hi All, The declaration of pthread_mutex_init in pthread.h is as in pthread.h Some one please explain. ( what is "__resrict", whay "__" before "mutex" and what is __THROW. extern int...
4
by: SamG | last post by:
I have installed ubuntu 6.10 on my intel PC and when i try to write a small c code and compile it i get an error saying the is reference to stdio.h i checked /usr/include and /usr/local/include...
17
by: lak | last post by:
if i view stdio.h there are only symbolic constants. where is the definition of printf and scanf is available? i want to see the definition of printf and scanf and where it is stored?
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.