Topic: What does 'shall not' mean in the (not) std?


Author: dabbler@cris.com (Dabbler@cris.com)
Date: 1997/09/01
Raw View
What does it mean when a behavior is identified as something that
'shall' or 'shall not' be done, but if it isn't or is:
1) the program is not ill-formed
2) the behavior isn't undefined
3) the behavior isn't implementation defined
4) no diagnostic is required

I'm thinking specifically of the requirement that user-defined names
'shall not' have double underscores in them, nor start with a single
underscore followed by a capital letter, but the situation also crops
up elsewhere.

--Homepage--> http://www.cris.com/~Dabbler/
PGP key available on my homepage, or try `finger dabbler@cris.com'
Floggings will continue until morale improves.
---
[ 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: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson)
Date: 1997/09/01
Raw View
dabbler@cris.com (Dabbler@cris.com) writes:

>What does it mean when a behavior is identified as something that
>'shall' or 'shall not' be done, but if it isn't or is:
>1) the program is not ill-formed
>2) the behavior isn't undefined
>3) the behavior isn't implementation defined
>4) no diagnostic is required

If the "shall" specifies a requirement on the _behaviour_ of the
program, then if it is violated, the behaviour is undefined, and
no diagnostic is required.  However, if the "shall" specifies a
requirement on the _form_ of the program, then if it is violated,
the program is ill-formed, and a diagnostic is required.
See 1.3[intro.compliance]/5.

>I'm thinking specifically of the requirement that user-defined names
>'shall not' have double underscores in them, nor start with a single
>underscore followed by a capital letter, but the situation also crops
>up elsewhere.

That one is quite explicit, and doesn't use "shall":

 |   17.3.3.1  Reserved names                          [lib.reserved.names]
 |
 | 3 If the program declares or defines a name in a  context  where  it  is
 |   reserved,  other than as explicitly allowed by this clause, the behav-
 |   ior is undefined.

 |   17.3.3.1.2  Global names                            [lib.global.names]
 |
 |   1 Certain  sets  of names and function signatures are always reserved to
 |     the implementation:
 |
 |     --Each name that begins with an underscore  and  either  an  uppercase
 |       letter  or  another underscore (_lex.key_) is reserved to the imple-
 |       mentation for any use.

 |  17.3.3.1.3  External linkage                        [lib.extern.names]
 |
 | 3 Each name having two consecutive underscores (_lex.key_)  is  reserved
 |   to  the  implementation  for  use  as  a name with both extern "C" and
 |   extern "C++" linkage.

--
Fergus Henderson <fjh@cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3         |     -- the last words of T. S. Garp.
---
[ 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                             ]