Article View: comp.std.c++
Article #1556Re: Linkage revisited
From: John Max Skaller
Date: Wed, 02 Aug 1995 16:38
Date: Wed, 02 Aug 1995 16:38
35 lines
1866 bytes
1866 bytes
In article <KANZE.95Jul25103036@slsvhdt.lts.sel.alcatel.de>,
James Kanze US/ESC 60/3/141 #40763 <kanze@lts.sel.alcatel.de> wrote:
>May I ask a question: why all these worries about qsort? Why not just
>use sort (section 25.3.1.1)? It is more flexible, and the benchmarks
>I've see suggest it is (as is to be expected) faster.
I agree completely with James. "qsort" is there for
C compatibility.
DONT USE IT!
It isn't clear it is POSSIBLE to use qsort.
Suppose extern "C" functions use a DIFFERENT calling convention.
Question 1: what is the calling convention of a function passed
to such a function -- C or C++? Answer: C because otherwise qsort
would not work.
Question 2: can you compile an extern "C" function in C++?
Answer: not necessarily.
Question 3: can you call code compiled with a C compiler?
Answer: not necessarily.
Result: qsort may not be useable: it has to be there,
it doesn't have to be useful. You certainly can't assume at this
point in time any use of it will be portable. The final Standard
might provide better guarrantees, but I have doubts.
--
JOHN (MAX) SKALLER, INTERNET:maxtal@suphys.physics.su.oz.au
Maxtal Pty Ltd,
81A Glebe Point Rd, GLEBE Mem: SA IT/9/22,SC22/WG21
NSW 2037, AUSTRALIA Phone: 61-2-566-2189
Technical Details
Message-ID:
<3vo9lr$los@metro.ucc.su.OZ.AU>Path:
arc1-ca.pugleaf.net!news.cs.su.oz.au!metro!newsReferences:
<bill_law-1807951030140001@bill-law.taligent.com> <3usgs3$rhi@godzilla.zeta.org.au> <3v011l$d69@godzilla.zeta.org.au> <KANZE.95Jul25103036@slsvhdt.lts.sel.alcatel.de>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.cs.su.oz.au!metro!news From: maxtal@Physics.usyd.edu.au (John Max Skaller) Newsgroups: comp.std.c++ Subject: Re: Linkage revisited Date: 2 Aug 1995 16:38:19 GMT Organization: School of Physics, University of Sydney, Australia Distribution: inet Message-ID: <3vo9lr$los@metro.ucc.su.OZ.AU> References: <bill_law-1807951030140001@bill-law.taligent.com> <3usgs3$rhi@godzilla.zeta.org.au> <3v011l$d69@godzilla.zeta.org.au> <KANZE.95Jul25103036@slsvhdt.lts.sel.alcatel.de> NNTP-Posting-Host: physics.su.oz.au