Topic: [Fwd: More M$ Not Conforming points...]
Author: jcoffin@taeus.com (Jerry Coffin)
Date: 1999/09/09 Raw View
In article <37D7C4E9.44F5@smarts.com>, jerrold.leichter@smarts.com
says...
>
> MSVC doesn't even conform to the *C* standard. One example that came
> out in some testing I did: printf's %e format produces exponential
> notation. The C Standard clearly states that the exponent shall consist
> of (a) an explicit sign; (b) at least two digits; (c) no more digits
> than are required to represent the value.
Where does it say that? Certainly NOT in the description I find in
section 7.9.6.1. It says the exponent shall always contain a minimum
of two digits, but places no maximum on the number of digits in the
exponent under any circumstances.
> With MSVC, printf("%e",123.456e15) produces 1.23456e+017. As a friend
> pointed out, MS seems to interpret "required" differently from the rest
> of us.
As far as I can see, the requirement exists only in your mind, not in
the standard itself. I find it hard to blame any vendor for lack of
conformance with a "requirement" that they have no way of knowing
exists at all.
--
Later,
Jerry.
The Universe is a figment of its own imagination.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: Michael Rubenstein <miker3@ix.netcom.com>
Date: 1999/09/10 Raw View
On 9 Sep 1999 16:36:59 GMT, Jerry Leichter
<jerrold.leichter@smarts.com> wrote:
>
>MSVC doesn't even conform to the *C* standard. One example that came
>out in some testing I did: printf's %e format produces exponential
>notation. The C Standard clearly states that the exponent shall consist
>of (a) an explicit sign; (b) at least two digits; (c) no more digits
>than are required to represent the value. This is the rule followed by
>every (non-MSVC) implementation I've ever used; I think the rule
>originally came from FORTRAN, many many years ago.
>
>With MSVC, printf("%e",123.456e15) produces 1.23456e+017. As a friend
>pointed out, MS seems to interpret "required" differently from the rest
>of us.
Could you give a citation. I cannot find this in the standard.
My copy says
The exponent always contains at least two digits.
I cannot find where it says that it must contain "no more digits
than are required to represent the value."
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: Jerry Leichter <jerrold.leichter@smarts.com>
Date: 1999/09/09 Raw View
MSVC doesn't even conform to the *C* standard. One example that came
out in some testing I did: printf's %e format produces exponential
notation. The C Standard clearly states that the exponent shall consist
of (a) an explicit sign; (b) at least two digits; (c) no more digits
than are required to represent the value. This is the rule followed by
every (non-MSVC) implementation I've ever used; I think the rule
originally came from FORTRAN, many many years ago.
With MSVC, printf("%e",123.456e15) produces 1.23456e+017. As a friend
pointed out, MS seems to interpret "required" differently from the rest
of us.
-- Jerry
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: Adam Spragg <adam_spragg@novaclarion.com>
Date: 1999/09/08 Raw View
Jeff Rife wrote:
>=20
> Witness 1.4/7 [intro.compliance]:
>=20
> "A freestanding implementation is one in which execution may take place
> without the benefit of an operating system, and has an implementation=AD=
defined
> set of libraries that includes certain language=ADsupport libraries (1=
7.4.1.3)."
>=20
> Now, bitch and moan about Windows 9x and Windows NT all you want, but t=
hey
> *do* qualify as operating systems.
But a freestanding implementation is not _required_ to take place
without the benefit of an operating system. No reason why a freestanding
implementation can't exist with the benefit of an OS, if the compiler
vendor can't be bothered to comply with the 'hosted implementation'
requirements.
Adam
--=20
Why is it that the smaller and easier a bug is to fix, the less I want
to actually fix it?
----------------
The opinions expressed in this email are mine alone, and do not
neccesarily represent those of my employer, my parents, or the people
who wrote the email software I use.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: Jeff Rife <jrife-news@nabs.net>
Date: 1999/09/06 Raw View
Adam Spragg (adam_spragg@novaclarion.com) wrote:
> Wow. You've written a GUI M$ Windows program, _without_ including any
> M$-specific headers??? :)
Well, no. It *could* be done by picking through them, and building your
own header that does the things you need. Maybe. But I doubt it.
> Ummmm.....surely Micro$oft can release a library with their compiler
> that is not neccessary for its use (the MFC library) that pre-defines
> main.
I'm not talking about MFC. I'm talking about a "Hello, world" Win32 GUI
program, which has an entry point of WinMain, and if you write a "main"
function, you will get a "multiply-defined" error.
In 3.6.1/1 [basic.start.main] of the C++ standard, we have:
"A program shall contain a global function called main, which is the
designated start of the program."
In 3.6.1/2, we have:
"An implementation shall not predefine the main function."
Thus, you *cannot* write a program for Win32 GUI that conforms to the
ISO/ANSI C++ standard using the Microsoft compiler.
> Is there anything that prevents a library writer from pre-defining
> main and requiring those that use the library have a different entry
> point to their program?
A *library* could do this, but the "main" function in a Win32 GUI program is
supplied by the C++ runtime library, which I would call "part of the
compiler implementation", and not "part of the Win32 library".
> I realise its staggeringly bad style, but a separate library that
> happens to be provided with the compiler that uses main() surely doesn't
> make the compiler itself non-conforming.
And, if it were a "separate" library, I would say it would squeak by, but
it isn't. It is part and parcel with the compiler. In this case, I would
say that anything that is shipped with the Microsoft compiler that is *not*
in the Microsoft Platform SDK (which is header files and libraries, but no
compiling tool) would be "part of the compiler".
--
Jeff Rife |
19445 Saint Johnsbury Lane | http://www.nabs.net/Cartoons/Dilbert/NoHelpDesk.jpg
Germantown, MD 20876-1610 |
Home: 301-916-8131 |
Work: 301-770-5800 Ext 5335 |
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: Salters <salters@lucent.com>
Date: 1999/09/06 Raw View
Jeff Rife wrote:
>
> William H. Bloodworth (whbloodworth@usa.net) wrote:
>
> > Portability is so constraining. I have not had the burden of making sure
> > everything is portable...since I develop for WinBlows and almost nothing
> > is portable that is writen for that platform.
No entire programs, no. Making a clean separation between data and presentation,
which is actually an official MS "good thing" (with MFC) can allow the reuse
of half a program.
Reality of course might force certain compromises, but this can often be
factored out in helper classes:
class Data {
private:
mutable Microsoft_type Prerendered;
...
};
Michiel Salters
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: "James Kuyper Jr." <kuyper@wizard.net>
Date: 1999/09/07 Raw View
Jeff Rife wrote:
....
> In 3.6.1/1 [basic.start.main] of the C++ standard, we have:
>
> "A program shall contain a global function called main, which is the
> designated start of the program."
That doesn't apply in a freestanding implementation. Of course, MSVC++
isn't conforming, and doesn't try to be, but if they ever did decide to
try, it would be as a freestanding implementation. Such situations are
precisely what the concept of freestanding implementations was invented
for.
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: Jeff Rife <jrife-news@nabs.net>
Date: 1999/09/07 Raw View
James Kuyper Jr. (kuyper@wizard.net) wrote:
> That doesn't apply in a freestanding implementation. Of course, MSVC++
> isn't conforming, and doesn't try to be, but if they ever did decide to
> try, it would be as a freestanding implementation. Such situations are
> precisely what the concept of freestanding implementations was invented
> for.
Although I have nothing to do with the committee, I don't think that's what
they meant at *all*.
Witness 1.4/7 [intro.compliance]:
"A freestanding implementation is one in which execution may take place
without the benefit of an operating system, and has an implementation defined
set of libraries that includes certain language support libraries (17.4.1.3)."
Now, bitch and moan about Windows 9x and Windows NT all you want, but they
*do* qualify as operating systems.
>From eariler posts, I've gotten the impression that freestanding implementations
would more likely be ones where the header files aren't even files, or other
really unusual (for us geeks more comfortable with an OS than a microcontroller)
settings.
In addition, since MSVC++ Win32 console programs are required to define main
within themselves (i.e., the compiler does *not* do it for you), I would
suspect that saying that Win32 console was a "hosted" implementation and
Win32 GUI is "freestanding" is beyond reasonable and into ludicrous. Only
if Microsoft was dying for certification and absolutely could not solve this
problem (hell, convincing the powers that be that the GUI part is an add-on
library is all it takes to solve it) otherwise would I suspect they would opt
for this route.
--
Jeff Rife | "There was a guy that was killed just like this
19445 Saint Johnsbury Lane | over in Jersey."
Germantown, MD 20876-1610 | "Yeah, but I figure, 'What the hell,
Home: 301-916-8131 | that's Jersey.'"
Work: 301-770-5800 Ext 5335 | -- "Highlander"
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: Francis Glassborow <francis@robinton.demon.co.uk>
Date: 1999/09/01 Raw View
In article <37cbcca4.36736183@news.airmail.net>, William H. Bloodworth
<whbloodworth@usa.net> writes
>Portability is so constraining.
But very good as a programming discipline. Of course if you only write
transient code you probably do not care, but even code with an intended
short live has a habit of hanging around (hence my wish for a Quick &
Dirty switch, where the compiler will refuse to compile the code more
than 12 hours after it is written:)
Francis Glassborow Journal Editor, Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA +44(0)1865 246490
All opinions are mine and do not represent those of any organisation
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: Jeff Rife <jrife-news@nabs.net>
Date: 1999/09/01 Raw View
William H. Bloodworth (whbloodworth@usa.net) wrote:
> Portability is so constraining. I have not had the burden of making sure
> everything is portable...since I develop for WinBlows and almost nothing
> is portable that is writen for that platform.
Well, for GUI Microsoft Windows programs, you *can't* be conforming, even
if you avoid including the MS-specific headers.
A GUI windows program pre-defines main (although console programs do not do
this), and the user entry point is WinMain. This is strictly prohibited by
the standard.
Thus, in this case, you can do anything that gets the job done, and not worry
too much about conformance.
--
Jeff Rife | Coach: What's the story, Norm?
19445 Saint Johnsbury Lane |
Germantown, MD 20876-1610 | Norm: Thirsty guy walks into a bar. You
Home: 301-916-8131 | finish it.
Work: 301-770-5800 Ext 5335 |
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: Adam Spragg <adam_spragg@novaclarion.com>
Date: 1999/09/02 Raw View
Jeff Rife wrote:
>
> William H. Bloodworth (whbloodworth@usa.net) wrote:
>
> > Portability is so constraining. I have not had the burden of making sure
> > everything is portable...since I develop for WinBlows and almost nothing
> > is portable that is writen for that platform.
>
> Well, for GUI Microsoft Windows programs, you *can't* be conforming, even
> if you avoid including the MS-specific headers.
Wow. You've written a GUI M$ Windows program, _without_ including any
M$-specific headers??? :)
> A GUI windows program pre-defines main (although console programs do not do
> this), and the user entry point is WinMain. This is strictly prohibited by
> the standard.
Ummmm.....surely Micro$oft can release a library with their compiler
that is not neccessary for its use (the MFC library) that pre-defines
main. Is there anything that prevents a library writer from pre-defining
main and requiring those that use the library have a different entry
point to their program?
I realise its staggeringly bad style, but a separate library that
happens to be provided with the compiler that uses main() surely doesn't
make the compiler itself non-conforming.
There are other 'features' of the M$ compiler that do that :)
Adam
--
Apparently [...] police in many lands are now complaining that local
arrestees are insisting on having their Miranda rights read to them,
just like perps in American TV cop shows. When it's explained to them
that they are in a different country, where those rights do not exist,
they become outraged. Starsky and Hutch reruns, dubbed into diverse
languages, may turn out, in the long run, to be a greater force for
human rights than the [United States] Declaration of Independence.
-- Neal Stephenson (Cryptonomicon -
http://www.io.com/~mccoy/beginning_print.html)
----------------
The opinions expressed in this email are mine alone, and do not
neccesarily represent those of my employer, my parents, or the people
who wrote the email software I use.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: whbloodworth@usa.net (William H. Bloodworth)
Date: 1999/09/01 Raw View
On 31 Aug 99 05:36:36 GMT, Jeff Rife <jrife-news@nabs.net> wrote:
>William H. Bloodworth (whbloodworth@usa.net) wrote:
>
>> I prefer not to drag in STDLIB just to get access to EXIT_SUCCESS &
>> EXIT_FAILURE. Usually, you only would use those in main (AFAIK) so wh=
y not
>> just use 0 and 1..or whatever error code you wish to return?
>
>Because, technically, only EXIT_SUCCESS and EXIT_FAILURE are portable.
>According to 18.3/8 [lib.support.start.term]:
>
>If status is zero or EXIT_SUCCESS, an implementation=ADdefined form of t=
he
>status successful termination is returned. If status is EXIT_FAILURE, an
>implementation=ADdefined form of the status unsuccessful termination is
>returned. Otherwise the status returned is implementation=ADdefined.
>
>Thus, although 0 is OK to use, anything other than 0 will result in
>an implementation-defined return status, because we can't *know* what
>EXIT_FAILURE is defined as, on a given implementation.
Portability is so constraining. I have not had the burden of making sure
everything is portable...since I develop for WinBlows and almost nothing =
is
portable that is writen for that platform.
William Bloodworth
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D Great Achievement REQUIRES Great Effort. =20
=3D =20
=3D William H. Bloodworth - whbloodworth@usa."net" ICQ: 21901934
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: jcoffin@taeus.com (Jerry Coffin)
Date: 1999/08/31 Raw View
In article <37c9dd14.1245621@news.airmail.net>, whbloodworth@usa.net
says...
[ ... ]
> I prefer not to drag in STDLIB just to get access to EXIT_SUCCESS &
> EXIT_FAILURE. Usually, you only would use those in main (AFAIK) so why not
> just use 0 and 1..or whatever error code you wish to return?
Because the only error codes you're assured of being able to return
are 0, EXIT_SUCCESS and EXIT_FAILURE. In particular, returning 1
doesn't necessarily mean failure. IIRC, under VMS, odd-numbered
return values are considered "success" codes.
--
Later,
Jerry.
The Universe is a figment of its own imagination.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: Jeff Rife <jrife-news@nabs.net>
Date: 1999/08/31 Raw View
William H. Bloodworth (whbloodworth@usa.net) wrote:
> I prefer not to drag in STDLIB just to get access to EXIT_SUCCESS &
> EXIT_FAILURE. Usually, you only would use those in main (AFAIK) so why not
> just use 0 and 1..or whatever error code you wish to return?
Because, technically, only EXIT_SUCCESS and EXIT_FAILURE are portable.
According to 18.3/8 [lib.support.start.term]:
If status is zero or EXIT_SUCCESS, an implementation defined form of the
status successful termination is returned. If status is EXIT_FAILURE, an
implementation defined form of the status unsuccessful termination is
returned. Otherwise the status returned is implementation defined.
Thus, although 0 is OK to use, anything other than 0 will result in
an implementation-defined return status, because we can't *know* what
EXIT_FAILURE is defined as, on a given implementation.
--
Jeff Rife | Coach: What would you say to a nice beer, Normie?
19445 Saint Johnsbury Lane |
Germantown, MD 20876-1610 | Norm: "Going down"?
Home: 301-916-8131 |
Work: 301-770-5800 Ext 5335 |
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: whbloodworth@usa.net (William H. Bloodworth)
Date: 1999/08/30 Raw View
On 27 Aug 1999 16:35:42 GMT, Bill Seymour <bsey@pobox.com> wrote:
>Christopher Eltschka asked:
>>
>> Does anyone use "return EXIT_SUCCESS;"?
>>
>
>Sometimes, if I'm also using EXIT_FAILURE.
>
>--Bill Seymour
I prefer not to drag in STDLIB just to get access to EXIT_SUCCESS &
EXIT_FAILURE. Usually, you only would use those in main (AFAIK) so why not
just use 0 and 1..or whatever error code you wish to return?
William Bloodworth
=====================================================================
= Great Achievement REQUIRES Great Effort.
=
= William H. Bloodworth - whbloodworth@usa."net" ICQ: 21901934
=====================================================================
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: Bill Seymour <bsey@pobox.com>
Date: 1999/08/27 Raw View
Christopher Eltschka asked:
>
> Does anyone use "return EXIT_SUCCESS;"?
>
Sometimes, if I'm also using EXIT_FAILURE.
--Bill Seymour
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]