From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,bb430b8922336f8 X-Google-Attributes: gidfee84,public From: Nikola Milutinovic Subject: Re: PGP and DUnix Date: 1998/12/24 Message-ID: <36821C1E.B6E45C08@ev.co.yu>#1/1 X-Deja-AN: 425475777 Content-Transfer-Encoding: 7bit References: <366F8B3F.5D46@tt.tampere.fi> To: "Seppo.Routimo" X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: EPS JP Elektrovojvodina Mime-Version: 1.0 Newsgroups: comp.unix.osf.osf1 "Seppo.Routimo" wrote: > > Hi > > Has anyone compiled PGP 5.0i on DUnix 4.0D? > I seem to have problems with the source, there > are few rows which end ;) and I think they should end ); > > If I change them, compile finds new errors and exits... I'm trying as well, so if anyone has done it, let us know, please. The problem is in "src/lib/bn/bnimem.c", more specifically in line like: BIG(ptr = (char *)ptr - oldbytes;) BIG is a macro: #if !defined(BN_BIG_ENDIAN) && !defined(BN_LITTLE_ENDIAN) #define BN_LITTLE_ENDIAN 1 #endif /* !BN_BIG_ENDIAN && !BN_LITTLE_ENDIAN */ #if BN_BIG_ENDIAN #define BIG(b) b #define LITTLE(l) /*nothing*/ #define BIGLITTLE(b,l) b #elif BN_LITTLE_ENDIAN #define BIG(b) /*nothing*/ #define LITTLE(l) l #define BIGLITTLE(b,l) l #else #error One of BN_BIG_ENDIAN or BN_LITTLE_ENDIAN must be defined as 1 #endif Basically, it should default to BN_LITTLE_ENDIAN, thus: #define BIG(b) /*nothing*/ #define LITTLE(l) l #define BIGLITTLE(b,l) l The problem is in the macro, the way I see it. It doesn't get recognized by the CPP. I've run "cc -P bnimem.c and in the resulting file I can see that BIG is not substituted, it remains after Pre-Processor and is treated as a function call. That is why we get a syntax error on "... ;)", If you reverse it, then you'll have linker errors, since there is no function called "BIG". As far as I can see, all header files are included OK, there is no BN_*_ENDIAN definition, though. So, it should default to LITTLE and all should go well. The problem could be in that "no define for either *_ENDIAN". Maybe, since BN_BIG_ENDIAN is not defined at all, the whole "#if ..." construction fails. What is the exact CC/CPP specification on this? I'll try making it "politically correct", by adding a line: #if !defined(BN_BIG_ENDIAN) && !defined(BN_LITTLE_ENDIAN) #define BN_LITTLE_ENDIAN 1 #define BN_BIG_ENDIAN 0 #endif /* !BN_BIG_ENDIAN && !BN_LITTLE_ENDIAN */ Nix. -- Le ave tha t spa ce alo ne!