🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #1490

Re: From C++ to Shining C

#1490
From: J. Kanze
Date: Thu, 03 Aug 1995 09:02
43 lines
2883 bytes
Richard A. O'Keefe (ok@goanna.cs.rmit.edu.au) wrote:
|> I wrote:
|> |> Let INT_MAX be 32767		(taken from a real limits.h file)
|> |> Let ARG_MAX be 1048320		(taken from a real limits.h file)
|> |> Do you see the problem here?  Increment your "boolean" often enough and
|> |> SIGFPE from an integer overflow is a real possibility, and
|> |> incrementing all the way back to 0 IS A REAL POSSIBILITY.

|> kanze@gabi-soft.fr (J. Kanze) writes:
|> >Except that in C++, boolean++ is defined as `boolean = true', not as
|> >incrementation.

|> You missed the point.  People keep on claiming that bool++ is going to be
|> allowed in order to support existing code.  _My_ point is simply that the
|> code in question has never been correct, has always been a breeding ground
|> of bugs just waiting for a chance to bite.

I, and I think many others, agree with you.

However, all (C) code which uses gets is also broken.  This didn't stop
the C standards committee from adapting `gets' as a standard function.
There is just too much code that uses it.  The fact that this code is
broken doesn't stop people from using it every day, and there is a large
faction which would scream loudly if it didn't compile anymore, because
the standard forbid it.

My own personal opinion would be for the standard to do the right thing,
and let the implementors (and quality of implementation issues) decide
how far they want to go with regards to backward compatibility.  I
definitly do not like having a function like gets in the standard; it
seems to me that this is explicit approval by the standards committee
for using it.

But I do not decide the standards committee's orientation in this
regard.  All I can say is that by accepting ++ for bool, the C++
standard is following in the footsteps of C.  More generally, my
opinions notwithstanding, this seems to be what the majority of people
want:-(.
-- 
James Kanze           (+33) 88 14 49 00          email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs Bourgeois, 67000 Strasbourg, France
Conseils en informatique industrielle--
                             --Beratung in industrieller Datenverarbeitung
Technical Details
Message-ID: <3vq3b6$2l5@gabi.gabi-soft.fr>
Path: arc1-ca.pugleaf.net!gabi-soft.fr!not-for-mail
References: <3t9lge$ngf@citadel.evolving.com> <3tgl2f$569@offas_dike.sbil.co.uk> <3tgsog$2gc@citadel.evolving.com> <3thkkk$437@fido.asd.sgi.com> <3tv3gv$b <3u1113$pjs@fido.asd.sgi.com> <3u6mgb$1nl@druid.borland.com> <3v7080$48n@goanna.cs.rmit.edu.au> <3va6j4$fa@gabi.gabi-soft.fr> <3vhsat$qv4@goanna.cs.rmit.edu.au>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!gabi-soft.fr!not-for-mail
From: kanze@gabi-soft.fr (J. Kanze)
Newsgroups: comp.std.c++,comp.std.c
Subject: Re: From C++ to Shining C
Followup-To: comp.std.c++,comp.std.c
Date: 3 Aug 1995 11:02:30 +0200
Organization: GABI Software, Sarl.
Message-ID: <3vq3b6$2l5@gabi.gabi-soft.fr>
References: <3t9lge$ngf@citadel.evolving.com> <3tgl2f$569@offas_dike.sbil.co.uk> <3tgsog$2gc@citadel.evolving.com> <3thkkk$437@fido.asd.sgi.com> <3tv3gv$b <3u1113$pjs@fido.asd.sgi.com> <3u6mgb$1nl@druid.borland.com> <3v7080$48n@goanna.cs.rmit.edu.au> <3va6j4$fa@gabi.gabi-soft.fr> <3vhsat$qv4@goanna.cs.rmit.edu.au>
NNTP-Posting-Host: gabi.gabi-soft.fr
X-Newsreader: TIN [version 1.2 PL2]