473,766 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what is cdecl

Hi, all.

I know this is not standard C, but I see the word cdecl used as a type
qualifier (?) in external declarations - including the standard
headers - and I'd like to know what it means (and how they it's used).
It is, as far as I know, an extension to std C by several compilers.
(Some use __cdecl instead, which is allowed by the standard.)

This may be off-topic on clc because it's not standard, but I believe
an extension that is common to many compilers isn't so far off the
mark. I apologize if I'm wrong on that point.

-- Marty Amandil (not quite ready to face the firing squad)
Mar 4 '08 #1
5 2977
In article <dc************ *************** *******@8g2000h se.googlegroups .com>,
Amandil <ma******@gmail .comwrote:
>Hi, all.

I know this is not standard C, but I see the word cdecl used as a type
qualifier (?) in external declarations - including the standard
headers - and I'd like to know what it means (and how they it's used).
It is, as far as I know, an extension to std C by several compilers.
(Some use __cdecl instead, which is allowed by the standard.)

This may be off-topic on clc because it's not standard, but I believe
an extension that is common to many compilers isn't so far off the
mark. I apologize if I'm wrong on that point.

-- Marty Amandil (not quite ready to face the firing squad)
As far as the dorks in this NG are concerned the use of the "cdecl"
"qualifier" is no more (and no less) relevant to the price of hay in
Kansas than is the use of the "ThroatWarb ler Mangrove" "qualifier" .

Mar 4 '08 #2
Amandil wrote:
Hi, all.

I know this is not standard C, but I see the word cdecl used as a type
qualifier (?) in external declarations - including the standard
headers - and I'd like to know what it means (and how they it's used).
It is, as far as I know, an extension to std C by several compilers.
(Some use __cdecl instead, which is allowed by the standard.)
When I want to know such things I use Google. Did you try that?

http://en.wikipedia.org/wiki/X86_cal...ventions#cdecl probably
tells you what you want to know.
This may be off-topic on clc because it's not standard, but I believe
an extension that is common to many compilers isn't so far off the
mark. I apologize if I'm wrong on that point.
From my brief examination of the webpage cited above, I get the
impression that it's a) platform-specific and b) not restricted to
C implementations . I'd say it's pretty off-topic. The firing squad
are loading their weapons, it's probably time for a final cigar...
Mar 4 '08 #3
On Mar 4, 12:07 pm, santosh <santosh....@gm ail.comwrote:
Amandil wrote:
Hi, all.
I know this is not standard C, but I see the word cdecl used as a type
qualifier (?) in external declarations - including the standard
headers - and I'd like to know what it means (and how they it's used).
It is, as far as I know, an extension to std C by several compilers.
(Some use __cdecl instead, which is allowed by the standard.)
This may be off-topic on clc because it's not standard, but I believe
an extension that is common to many compilers isn't so far off the
mark. I apologize if I'm wrong on that point.

It's a compiler attribute to specify the C calling convention for that
function. A calling convention specifies the machine level interface of
that function, i.e, where the function expects it's arguments, where it
returns it's return value, whether it pops of it's arguments or whether
the caller must do that and other such details.
<etc. Snipped for brevity. I hate long quotes>

Thanks. I basically know about the C calling convention, so I
understand your answer well enough. I hadn't known about cdecl being
related to those, though.

-- Marty
Mar 4 '08 #4
In article <fq**********@a ioe.org>,
Mark Bluemel <ma**********@p obox.comwrote:
>Amandil wrote:
>Hi, all.

I know this is not standard C, but I see the word cdecl used as a type
qualifier (?) in external declarations - including the standard
headers - and I'd like to know what it means (and how they it's used).
It is, as far as I know, an extension to std C by several compilers.
(Some use __cdecl instead, which is allowed by the standard.)

When I want to know such things I use Google. Did you try that?

http://en.wikipedia.org/wiki/X86_cal...ventions#cdecl probably
tells you what you want to know.
Note that, according to the dogma of clc, Wikipedia is a) the work of
the devil and b) completely unreliable. If you don't believe me, feel
free to use Google Groups and you'll see.

So, one certainly can't use Wikipedia as a suggested reference resource
and still expect to keep one's Clique membership in good standing.

Furthermore, and I'm now speaking entirely seriously, without
tongue-in-cheek, maybe the OP would actually *like* to hear your
opinions. Maybe he actually would prefer the commentary of real, live,
honest-to-goodness humans, instead of sterile cold reference material.

Ever think of that?

P.S. Of course, once he's spent some time in CLC, he'll realize that
there aren't any real, live, honest-to-goodness humans here, but that
doesn't mean he can't come in with honest expectations.

Mar 4 '08 #5

I was all set to say that "__cdecl" and "__stdcall" were C and C++
keywords, because they always turn blue in every IDE I've used.

But, on looking for them in the standards, I see that just aint so!

On doing some googling, it seems these are mostly (or perhaps solely)
Microsoft Windows features. They appear not to be used in any other
operating system. Try asking about them in the following groups:

comp.os.ms-windows.program mer.win32
microsoft.publi c.win32.program mer

But in a nutshell, these two declarators specify how the stack is
used when a function is called. For "__cdecl", the calling function
does the stack clean-up; for "__stdcall" , the called function does
the stack clean-up. Also, "__stdcall" doesn't handle functions with
variable number of arguments. In practice, "__stdcall" is used for
all API callback functions, and "__cdecl" is used for everything
else.

--
Cheers,
Robbie Hatley
lonewolf aatt well dott com
www dott well dott com slant user slant lonewolf slant
Mar 5 '08 #6

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

Similar topics

6
27772
by: G Patel | last post by:
I've been looking at some code for string functions (certain implementation of them) and the non modified string is usually declared as a const char *s in the parameter list. I was wondering, what exactly does that mean. Does that mean the function is restricted from changing the address (changing s) or changing what's being pointed to (*s)?
12
2538
by: Tor Rustad | last post by:
Did a fun project some years ago.. a cdecl, but never really tested it. Here are some test cases I just tried: cdecl> char **argv; cdecl> argv is pointer to pointer to char Looks ok cdecl> int (*daytab); cdecl> daytab is pointer to array of int
3
1180
by: Klein | last post by:
const S_Table_Structure * const * cur = table;
19
872
by: sabarish | last post by:
Hi friend, what is the use of function pointer in c language and where it is useful? tell with simple example...? plz help me.
12
8420
by: hn.ft.pris | last post by:
I know int *p mean an array of pointers to int, but I meet int (*p) which is confusing. What does it mean and how to use it? Thanks for help.
5
1963
by: richard.wm.jones | last post by:
I'm trying to track down the original authors of cdecl. cdecl was dropped from Fedora Core a few years ago because of licensing concerns. The original postings to comp.sources.unix (vols 6 & 14 in 1986 and 1988 respectively) have no licensing information. In order to get cdecl back in we would need a definitive statement from key original authors that the code can be distributed under a free license (eg. GPL or BSD-style licenses, or...
2
2932
by: Udi | last post by:
Hi All, I have a C dll exporting the following: ```````````````````````````````````````````````````` typedef void (__cdecl *pCallBack)(int i); int __cdecl Foo(pCallBack pFunc); I have written an interop dll:
13
5057
by: shanti | last post by:
hi, I know that this may not be the question has to be raised in this group. in comp.lang.c FAQ list · Question 1.21 i read about cdecl . i am working with "turbo c" on a windows xp mechine. can any one provide link where i can get the compatable cdecl. i tryed but i could not found it in google search. please help me. thanks to the group and members. regards, prasanth.
6
1710
by: Shraddha | last post by:
What is this exactly... int(*(*ptr (int))(void) First I thought that this is the pointer to function...But I recognize that the syntax iss quite different... If we say that the function is taking void parameters i.e. no parameters then what "(int i)" is doing there...
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10168
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10008
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9837
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...
1
7381
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
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
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...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2806
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.