[4241] in Athena Bugs

home help back first fref pref prev next nref lref last post

hc2.1y -Hansi

daemon@ATHENA.MIT.EDU (Ken Raeburn)
Thu Feb 15 15:45:58 1990

Date: Thu, 15 Feb 90 15:45:28 -0500
From: Ken Raeburn <Raeburn@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU, jfc@ATHENA.MIT.EDU

From hc2(1):

     -Hansi
          Causes the compiler to only accept programs conforming
          to the proposed ANSI standard.

Source file:

extern int i, j, k;
void foo (void) {
        i = 1;
        int q;		/* <= decl after statement -- error */
}

Compiler execution result:

% hc2.1y -O -S xxx.c -v -Hansi
/lib/cpp -D__STDC__ xxx.c /tmp/pp.005034
/afs/athena/user/j/jfc/bin/hc1com /tmp/pp.005034 -efile @E -silent -on CHAR_DEFAULT_UNSIGNED -off DOUBLE_MATH_ONLY -on DOUBLE_RETURN -on LONG_ENUMS -off PCC -on PCC_MSGS -ofile /tmp/IL1005034 -vfile /tmp/var005034 -machine rtfl -define ibm032 1 -ansi -pro hc.pro -copyr -st /usr/lib/hc/hcansi.st -pt /usr/lib/hc/hcansi.pt -spt /usr/lib/hc/hcansip.pt -dir /usr/include
MetaWare High C Compiler R2.1y
(c) Copyright 1987-89, MetaWare Incorporated

E "/tmp/t0005036",L1/C8:        (syntactic)  unexpected symbol:'<IDENTIFIER>':ibm032
REPAIR:   '#pragma' replaces '<CONTROL>'@"/tmp/t0005036",L1/C2

E "/tmp/t0005036",L2/C2:        (syntactic)  unexpected symbol:'<CONTROL>':define
REPAIR:   C_phrase_structure-nnt6@"/tmp/t0005036",L2/C1 through '<CONTROL>':define@"/tmp/t0005036",L2/C2 was deleted

E "/tmp/t0005036",L2/C16:       (syntactic)  unexpected symbol:'<INTEGER>':1
DELETED:  '<INTEGER>':1@"/tmp/t0005036",L2/C16
REPAIR:   '<NO_PARMS>'@"/tmp/t0005036",L2/C9 through '<DONE>'@"/tmp/t0005036",L2/C17 was deleted

E "/tmp/pp.005034",L1/C3:       (syntactic)  unexpected symbol:'<INTEGER>':1
DELETED:  '<INTEGER>':1@"/tmp/pp.005034",L1/C3
REPAIR:   '<CONTROL>'@"/tmp/pp.005034",L1/C3 through '<DONE>'@"/tmp/pp.005034",L1/C12 was replaced with ';'
4 user errors   No warnings
Exit 8               hc2.1y -O -S xxx.c -v -Hansi
 [prometheus!raeburn]
 {/tmp}
<1041  3:26pm> %

(hc2.1y is a script that runs "hc2 -B...")

The code does deserve some complaint, but the complaints made appear
to have nothing to do with the code itself.  (I was using this test
file to see if my previous bug report was fixed with 2.1y, with or
without the `ansi' flag.  Apparently not....)

It looks as though a line "#define ibm032 1" were being prepended to
the preprocessor *output*, and then fed to the next stage of parsing
without any further preprocessing.

Under 2.1s the results are the same as if "-Hansi" was not supplied
(i.e., still no complaint about the code, but otherwise okay).

The output with "-Hansi -Hnocpp" is only slightly better:

 % hc2.1y -O -S xxx.c -v -Hansi -Hnocpp
/afs/athena/user/j/jfc/bin/hc1com xxx.c -efile @E -silent -on CHAR_DEFAULT_UNSIGNED -off DOUBLE_MATH_ONLY -on DOUBLE_RETURN -on LONG_ENUMS -off PCC -on PCC_MSGS -ofile /tmp/IL1005056 -vfile /tmp/var005056 -machine rtfl -define ibm032 1 -ansi -pro hc.pro -copyr -st /usr/lib/hc/hcansi.st -pt /usr/lib/hc/hcansi.pt -spt /usr/lib/hc/hcansip.pt -dir /usr/include
MetaWare High C Compiler R2.1y
(c) Copyright 1987-89, MetaWare Incorporated

E "/tmp/t0005057",L1/C8:        (syntactic)  unexpected symbol:'<IDENTIFIER>':ibm032
REPAIR:   '#pragma' replaces '<CONTROL>'@"/tmp/t0005057",L1/C2

E "/tmp/t0005057",L2/C2:        (syntactic)  unexpected symbol:'<CONTROL>':define
REPAIR:   C_phrase_structure-nnt6@"/tmp/t0005057",L2/C1 through '<CONTROL>':define@"/tmp/t0005057",L2/C2 was deleted

E "/tmp/t0005057",L2/C16:       (syntactic)  unexpected symbol:'<INTEGER>':1
REPAIR:   '<NO_PARMS>'@"/tmp/t0005057",L2/C9 through '<DONE>'@"/tmp/t0005057",L2/C17 was replaced with ';'
3 user errors   No warnings
Exit 8               hc2.1y -O -S xxx.c -v -Hansi -Hnocpp
 [prometheus!raeburn]
 {/tmp}
<1046  3:32pm> %

So much for -Hansi....

-- Ken

home help back first fref pref prev next nref lref last post