ONC+ Developer's Guide

Syntax Notes

  1. The following are keywords and cannot be used as identifiers:

    Table C-1 XDR Keywords

    bool

    const

    enum

    int

    string

    typedef

    void

    cas

    default

    float

    opaque

    struct

    union

     

    cha

    double

    hyper

    quadruple

    switch

    unsigned

     

  1. Only unsigned constants may be used as size specifications for arrays. If an identifier is used, it must have been declared previously as an unsigned constant in a const definition.

  2. Constant and type identifiers within the scope of a specification are in the same name space and must be declared uniquely within this scope.

  3. Similarly, variable names must be unique within the scope of struct and union declarations. Nested struct and union declarations create new scopes.

  4. The discriminant of a union must be of a type that evaluates to an integer. That is, int, unsigned int, bool, an enum type, or any typedef that evaluates to one of these. Also, the case values must be legal discriminant values. Finally, a case value may not be specified more than once within the scope of a union declaration.