Bugs in RISC System/6000 C compiler

Horace Dediu hhd0 at GTE.COM
Thu Sep 20 06:56:02 AEST 1990


While doing a compile, I get the following errors:
	cc -g -I. -Dvax -DUSE_VARARGS=1 -DUSE_PROTOTYPES=0 -c tif_dir.c
      803 |         { if (((tif)->tif_dir.td_fieldsset[FIELD_GRAYRESPONSECURVE/
            ...........................................a.....b.................
a - 1506-045: (S) Undeclared variable.
b - 1506-046: (S) Syntax error.

and many more of the same character.

The equivalent line of code (803) in tif_dir.c is:
	CleanupField(GRAYRESPONSECURVE, td_grayresponsecurve);

where
#define CleanupField(field, member) {           \
    if (TIFFFieldSet(tif, CAT(FIELD_,field))) { \
        free((char *)td->member);               \
        td->member = 0;                         \
    }                                           \
}
and
#define TIFFFieldSet(tif, field) \
    ((tif)->tif_dir.td_fieldsset[field/32] & (1L<<(field&0x1f)))

So what we have here is a double macro substitution.  The compiler does not
handle this properly.  I found that the code compiled fine on VAX and MIPS
architectures (plus many others the author of the code has ported to--SG,
Sun, Tahoe, etc.).

Is the problem with the compiler or is there some new convention that no such
substitutions are allowed?  I suspect the former, since the substitutions 
are performed (see the original error message).
-- 
Horace Dediu \"That's the nature of research--you don't know |GTE Laboratories
(617) 466-4111\  what in hell you're doing." `Doc' Edgerton  |40 Sylvan Road
UUCP:  ...!harvard!bunny!hhd0................................|Waltham, MA 02254
Internet: hhd0 at gte.com or hhd0%gte.com at relay.cs.net..........|U. S. A.



More information about the Comp.unix.aix mailing list