473,659 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 17073
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_NAMESPAC E_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_NAMESPAC E_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
2290
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
4518
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
1723
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
2764
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 <stdio.h>. i need your help, thanks a lot.
2
14567
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 following lines inside only: -------content of cstdio on red hat linux enterprise 3---- #ifndef __CSTDIO__ #define __CSTDIO__ #include <stdio.h> #endif
4
4399
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 pthread_mutex_init (pthread_mutex_t *__restrict __mutex, __const pthread_mutexattr_t *__restrict __mutex_attr) __THROW;
4
2980
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 and i searched the whole system for stdio.h file but i was not able to find the file. My gcc is there but how come the stdio.h is not included. How to get around this problem, it seems non of the glibc include
17
8926
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
8341
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8539
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8630
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2759
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.