Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!julius.cs.uiuc.edu!apple!bbn.com!nic!bunny!hhd0 From: hhd0@GTE.COM (Horace Dediu) Newsgroups: comp.unix.aix Subject: Bugs in RISC System/6000 C compiler Keywords: bad macro substitution Message-ID: <9756@bunny.GTE.COM> Date: 19 Sep 90 20:56:02 GMT Organization: GTE Laboratories, Inc., Waltham, MA Lines: 36 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@gte.com or hhd0%gte.com@relay.cs.net..........|U. S. A.