Compatibility Of Types For C And Pascal; Table 6-1 C And Pascal Size And Alignment Of Compatible Types - Sun Microsystems SunSoft Pascal 4.0 User Manual

Hewlett-packard user guide printer printer
Table of Contents

Advertisement

6

Compatibility of Types for C and Pascal

90
The -c option produces an unlinked object file. The -calign option causes
pc to use C-like data formats for aggregate objects.
When you compile a Pascal main routine that calls C, you don't have to use
any special options, but the -calign option is again useful. The C object
library, libc, is automatically brought in for every Pascal compilation.
For example:
hostname% cc -c my_c.c
hostname% pc -calign my_c.o my_pascal.p
Table 6-1 and Table 6-2 list the default sizes and alignments of compatible
types for C and Pascal.
Table 6-1
C and Pascal Size and Alignment of Compatible Types
Pascal Type
C Type
double
double
longreal
double
real
double
single
float
shortreal
float
integer16
short int
integer32
int
integer
int
-128..127
char
boolean
char
alfa
char a[10
char
char
string
char a[80]
varying[n] of char
struct {int, char[n]}
record
struct/union
Pascal 4.0 User's Guide
Size (bytes)
8
8
8
4
4
2
4
4
1
1
]
10
1
80
-
-
Alignment (bytes)
8
8
8
4
4
2
4
4
1
1
1
1
1
4
Same as element type

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SunSoft Pascal 4.0 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents