Topic: Clarification


Author: "Joe Halpin" <jhalpin@nortel.ca>
Date: 1997/02/28
Raw View
I'm curious about the following paragraph from the working paper that
was recently released:

"  1.3  Implementation compliance                     [intro.compliance]

[...]

2 Every conforming C++ implementation shall, within its resource
limits, accept and correctly execute well-formed C++ programs, and shall
issue at least one diagnostic message when  presented  with  any
ill-formed program  that contains a violation of any diagnosable
semantic rule or of any syntax rule."

What, specifically, does the phrase "within its resource limits" mean?
For example, if an implementation was targeted to a small platform,
could it choose to not implement parts of the standard? If so, would
it be required to issue a diagnostic for parts of the language which
it would not accept and correctly execute?

Thanks

Joe
---
[ 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         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]





Author: Stephen.Clamage@Eng.Sun.COM (Steve Clamage)
Date: 1997/03/03
Raw View
In article MAA18585@newncar.ucar.edu.ucar.EDU, "Joe Halpin" <jhalpin@nortel.ca> writes:
>I'm curious about the following paragraph from the working paper that
>was recently released:
>
>"  1.3  Implementation compliance                     [intro.compliance]
>
>[...]
>
>2 Every conforming C++ implementation shall, within its resource
>limits, accept and correctly execute well-formed C++ programs, and shall
>issue at least one diagnostic message when  presented  with  any
>ill-formed program  that contains a violation of any diagnosable
>semantic rule or of any syntax rule."
>
>What, specifically, does the phrase "within its resource limits" mean?
>For example, if an implementation was targeted to a small platform,
>could it choose to not implement parts of the standard?

Not really, at least that is not the intent of that provision. The
standard defines the language, and a conforming implementation
must implement the language.

"Resource limits" applies to things like the maximum size of a program
which can be created, max length of external identifiers, max size of
a single function, max number of members of a class, if such limits
exist (singly or in combination).

For example, an implementation for mainframes could perhaps create
a program gigabytes in size, having millions of functions and external
identifiers. An implementation targeted at palmtop computers could
be conforming (allow all language features) without being able to
handle such a large program -- you couldn't run that program on the
palmtop anyway.

Another example: Some early C and C++ validation suites contained
artificial functions containing thousands of statements that just verify
that all possible expression types can be correctly handled. Some
compilers can't handle a function with that many statements, and
indeed the C and C++ standards don't require them to do so. Accordingly,
the validation suites broke up those functions into smaller
subfunctions.

Apart from the "resource limits" provision, the C and C++ standards
recognize two types of conforming implementations: "hosted" and
"freestanding". A "hosted" implementation targets ordinary platforms
with displays and I/O. A "freestanding" implementation targets embedded
systems, or platforms which are limited in various ways; they might not
have an operating system and need supply only a very limited (but
specified) part of the standard library.

A C++ implementation which omits support for language features (apart
from library features which may be omitted in freestanding
implementations) is not conforming. At least, it is not intended
to be conforming.

For example, it might be possible to omit some features and still
claim conformance under "resource limits" or "implementation-defined"
clauses of the standard. I don't think it is possible to prevent
useless implementations from falling narrowly into the "conforming"
category, if someone is perversely determined to try. I also don't
think it is worthwhile worrying about that eventuality. When you
select a compiler, you must determine whether it meets YOUR needs,
and the presence of a "certified standard" label would surely not be
the only criterion.
---
Steve Clamage, stephen.clamage@eng.sun.com
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]





Author: swf@elsegundoca.ncr.com (Stan Friesen)
Date: 1997/03/04
Raw View
In article <199702271947.MAA18585@newncar.ucar.edu.ucar.EDU>, "Joe
Halpin" <jhalpin@nortel.ca> writes:
|>
|> What, specifically, does the phrase "within its resource limits" mean?

It means an implementation can place restrictions on the complexity or
size of a program it will translate.

For instance, there might be a limit on nesting levels, or a limit on
number of external variables visible in a module, or any similar limit.

|> For example, if an implementation was targeted to a small platform,
|> could it choose to not implement parts of the standard? ...

Not as far as I know.

--
swf@elsegundoca.ncr.com  sarima@ix.netcom.com

The peace of God be with you.
---
[ 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         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]





Author: maxtal@Physics.usyd.edu.au (John Max Skaller)
Date: 1995/07/19
Raw View
In article <objsoftDBIDC1.AwE@netcom.com>,
ObjectSoftware <objsoft@netcom.com> wrote:
>Greetings:
>
>C++ Draft: Section : 15.4 : Exception specifications
>
>The wordings on Item 1 & Item 2 are somewhat misleading. I
>am able to grasp the meaning, but at first glance they
>appeared confusing. e.g.,
>
>Item 1:
>
>"An exception-specification shall appear only on a function
> declarator in a declaration or definition."
> ^^^^^^^^^^                  ^^ ^^^^^^^^^^

 This is misleading. The words "or definition" are not
necessary. A definition is a declaration.

> Item 2:
>
> "If any declaration of a function has an exception-specification
>  all declarations, including the definition, of that function
>  ^^^               ^^^^^^^^^^^^^^^^^^^^^^^^
>  shall have an exception-specification with the same set of
>  type-ids."

 As above. It is a case of the committee being unable
to come to grips with writing a Standard not a reference manual.
Saying "including the definition" is not normative, just a reminder
to the reader that the intent includes those declarations which
are also definitions.

--
        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





Author: objsoft@netcom.com (ObjectSoftware)
Date: 1995/07/10
Raw View
Greetings:

C++ Draft: Section : 15.4 : Exception specifications

The wordings on Item 1 & Item 2 are somewhat misleading. I
am able to grasp the meaning, but at first glance they
appeared confusing. e.g.,

Item 1:

"An exception-specification shall appear only on a function
 declarator in a declaration or definition."
 ^^^^^^^^^^                  ^^ ^^^^^^^^^^

 Item 2:

 "If any declaration of a function has an exception-specification
  all declarations, including the definition, of that function
  ^^^               ^^^^^^^^^^^^^^^^^^^^^^^^
  shall have an exception-specification with the same set of
  type-ids."

At first, Item 1 & 2 appeared contradictory. I was wondering
if the wording on these items be simplified.

Thanks.

Bobby Sardana.
ObjectSoftware, Inc.
C++ Development, Documentation & Testing Tools.
objsoft@netcom.com
URL: ftp://ftp.netcom.com/pub/ob/objsoft/htmlinfo/Testing.html