summaryrefslogtreecommitdiff
path: root/dviware/crudetype/version3/w2cbugs
blob: d9e1b12de923750c477b6cfde971c30d93c03d2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
LIST of bugs in current version of my web2c. (Nov. 1990)

POINTERS Crashes on self-referencing  structures, e.g.

type horse = ^cow ;
  cow=record
    log : horse;
 (etc)


In C this must all be rewritten approx. as follows:

struct xyz {
  xyz *log ;
  (etc)


followed by

typedef struct xyz cow ;
typedef cow *horse ;



WITH statements. Fails because if you have an array of records,
W2C knows the component type of the array is a record, but not
what type of record it is. 

Variant records. A simple translation fails because you have to 
name all the intermediate places on the way down from top level.
For example:

  codeobject = packed record
    breadth: iword ;
    case boolean of
      true: (IMfont: byte ; IMchar: byte );
        {Printers font and character}
      false: (multi: iword) ;
  end;

must be translated approx:

typedef struct {
  iword breadth ;
  union{
    struct{
      byte IMfont ;
      byte IMchar ;
    } XXA ;
    iword multi ;
  } XXB ;
} codeobject ;


Then if C is a codeobject, C.IMfont must be translated as
C.XXB.XXA.IMfont