Previous Next Contents Index Doc Set Home


Implementation Restrictions

C


This Appendix describes the Pascal features that are implementation-defined.


Identifiers

Pascal restricts the maximum length of an identifier to 1,024 characters. All characters are significant.

Identifiers in a nested procedure are concatenated with the identifier of the containing procedure. Thus, an identifier in a deeply nested procedure may become several hundred characters when concatenated and may cause problems with the compiler. Pascal generates an error when this situation occurs.


Data Types

This section describes the restrictions Pascal places on the following data types:

real

Table C-1 lists the minimum and maximum values Pascal assigns to the real data types, single and double.




Table  C-1 Values for single and double

Type
Bits
Maximum Value
Minimum Value

single

32

3.402823e+38

1.401298e-45

double

64

1.79769313486231470e+308

4.94065645841246544e-324

Integer

The value Pascal assigns to the integer constants maxint and minint depends on whether or not you compile your program with the -xl option, as shown in Table C-2.




Table  C-2 maxint and minint

Option
maxint
minint

-xl off

2,147,483,647

-2,147,483,648

-xl on

32,767

-32,768

Character

Pascal defines the maximum range of characters as 0 to 255.

Record

Pascal restricts the maximum size of a record to 2,147,483,647 bytes.

Array

Pascal restricts the maximum size of an array to 2,147,483,647 bytes.

Set

Pascal restricts the maximum size of a set to 32,767 elements.

Alignment

The size and alignment of data types depends on whether or not you compile your program with the -xl option. Table C-3 shows the representation of data types without -xl, and Table C-4 shows the representation with -xl.




Table  C-3 Internal Representation of Data Types without -xl-

Data Type
Size
Alignment

integer

Four bytes

Four bytes

integer16

Two bytes

Two bytes

integer32

Four bytes

Four bytes

real

Eight bytes

Eight bytes

single

Four bytes

Four bytes

shortreal

Four bytes

Four bytes

double

Eight bytes

Eight bytes

longreal

Eight bytes

Eight bytes

boolean

One byte

One byte

char

One byte

One byte

enumerated

One or two bytes, depending on the number of elements in the enumerated set

One or two bytes

subrange

One, two, or four bytes

One, two, or four bytes

record

Depends upon the base type of that field.

Four bytes

array

Requires the same space required by the base type of the array.

Same as element type

set

Pascal implements vector, with one bit representing each element of a set. The size is determined by the size of the ordinal value of the maximal element of the set plus one. It is a minimum of two bytes and always in two-byte multiples.

Two bytes if size = 2; otherwise, four bytes

pointer

Four bytes

Four bytes


Table  C-4 Internal Representation of Data Types with -xl

Data Type
Size
Alignment

integer

Two bytes

Four bytes

integer16

Two bytes

Two bytes

integer32

Four bytes

Four bytes

real

Four bytes

Eight bytes

single

Four bytes

Four bytes

shortreal

Four bytes

Four bytes

double

Eight bytes

Eight bytes

longreal

Eight bytes

Eight bytes

boolean

One byte

One byte

char

One byte

One byte

enumerated

Two bytes

Two bytes

subrange

Two or four bytes

Two or four bytes

record

Depends on the base type of that field.

Four bytes

array

Needs the same space required by the base type of the array.

Same as element type

set

Pascal implements sets as a bit vector, with one bit representing each element of a set. The size is determined by the size of the ordinal value of maximal element of the set plus one. It is a minimum of two bytes and always in two-byte multiples.

Two bytes if size = 2; otherwise, four bytes

pointer

Four bytes

Four bytes


Nested Routines

Pascal allows a maximum of 20 levels of procedure and function nesting.


Default Field Widths

The write and writeln statements assume the default values in Table C-5 if you do not specify the minimum field length of a parameter.




Table  C-5 Default Field Widths

Data Type

Default Width without -xl Option

Default Width with -xl Option

array of char

Declared length of the array

Declared length of the array

boolean

Length of true or false

15

char

1

1

double

21

21

enumerated

Length of type

15

hexadecimal

10

10

integer

10

10

integer16

10

10

integer32

10

10

longreal

21

21

octal

10

10

real

21

13

shortreal

13

13

single

13

13

string constant

Number of characters in the string

Number of characters in the string

variable-length string

Current length of the string

Current length of the string


Previous Next Contents Index Doc Set Home