comments from UK reviewer

Rex Jaeschke uunet!aussie.COM!rex
Sat Jul 3 13:24:48 PDT 1993


I'm forwarding this posting. The comments are based on ``the document with
the above number made available for review earlier this year.'' It i
spossible the document was revised since then. Th eposter is active in the
internationalization issues of ISO C.


From: uunet!x.co.uk!clive (Clive Feather)
Subject: (SC22WG14.417) Comments on the NCEG proposals
To: dkuug.dk!sc22wg14
Date: Mon, 28 Jun 93 17:42:16 BST

I'm not sure if this is the right place to mail this; if not, can
someone please forward it, and I apologise for the inconvenience.


Comments on the Floating-Point C Extensions
===========================================
Document X3J11.1/93-001

This is a set of comments on the document with the above number made
available for review earlier this year. These comments are my own and
are not the responsibility of BSI.


3.3.2 states that the additional comparison operators have the same
precedence as the Standard C relational operators. Does it mean the
precedence of ">", or of "==" ?


4.2.1 defines extra subject sequences for several functions, such as
strtod. If a program consists of a translation unit compiled with these
extensions, and one compiled without, and each call strtod in the "C"
locale, the standards require different actions. Such changes should be
avoided - the author of one translation unit does not necessarily even
know whether other translation units are compiled with these features or
not. These functions should be renamed.

A similar problem occurs with fscanf in 4.2.2.2.


4.2.2.1 and 4.2.2.2 introduce a new specifier, %A, which is in the
namespace reserved to extensions. This might or might not be viewed as a
problem.


4.3.1 introduces "overloaded functions". Because of the special
semantics of these, they should be in a separate header. Because of
namespace issues, a translation unit using their names (other than when
the name is reserved by ISO/IEC 9899:1990) without including that header
should not be affected, even if linked with one using the header. In
other words, given:

    translation unit A: defines a function "int asinh (int, FILE *)"
    translation unit B: calls asinh with two arguments: 1 and stdout
    translation unit C: includes <fp.h> and calls asinh with argument 3.5

if these three are linked, the call in B should reference the function in
A while the call in C references the NCEG function.


Namespace issues:
The following names appear from Appendix C to be the overloaded names;
the comment above about 4.3.1 applies to them:

    acosh
    asinh
    atanh
    ceil
    copysign
    erf
    erfc
    exp2
    expm1
    fdim
    floor
    fmax
    fmin
    fpclassify
    gamma
    hypot
    lgamma
    log1p
    log2
    logb
    nearbyint
    nextafter
    remainder
    remquo
    rint
    round
    scalb
    signbit
    trunc

The following functions use names not in the external namespace reserved
by ISO/IEC 9899:1990. They should either be renamed into the reserved
namespace, or they should be specified as only having the given meaning
following the inclusion of some header (say <fp.h>), and not being
related to functions of the same name defined without that header being
included (in other words, if not renamed, the comment about overloaded
functions should apply equally to these functions). In addition, the
names grouped with parentheses do not differ in their first six
characters.

    feclearexcept
    fegetenv        )
    fegetexcept     )
    fegetround
    feholdexcept
    fereaiseexcept
    fesetenv        )
    fesetexcept     )
    fesetround
    fetestexcept
    feupdateenv
    nan
    nanf
    nanl
    nextafterd      )
    nextafterf      )
    nextafterl      )
    rinttol
    roundtol

--
Clive D.W. Feather     | IXI Ltd (an SCO company) | If you lie to the compiler,
cliveax.co.uk          | Vision Park              | it will get its revenge.
Phone: +44 223 236 555 | Cambridge   CB4 4ZR      |   - Henry Spencer
Fax:   +44 223 236 466 | United Kingdom           |


Rex

----------------------------------------------------------------------------
(703) 860-0091  |           Rex Jaeschke              | C and C++ Seminars
rexaaussie.com  |        2051 Swans Neck Way          | and Consulting
                |     Reston, Virginia 22091, USA     | 
----------------------------------------------------------------------------
Chair of X3J11 and X3J11.1, and member of US delegation to SC22/WG14
C/C++ editor for DEC Professional magazine
----------------------------------------------------------------------------




More information about the Numeric-interest mailing list