On Mon, 2013-09-23 at 15:33 +0100, Francis Stevens wrote:
> I have also hit this compilation issue, also on an old RedHat system. 
> Looking in the sources for the file libclamav/7z/Types.h for 0.97.8 
> there are some edits that seem to be working around this issue which 
> don't appear in the corresponding Types.h file for 0.98.  The diff 
> output is a bit long so here are the relevant bits...
> 
> at line 13
> 
> /* aCaB -- lame workaround for "Byte" refef */
> #include <zconf.h>
> 
> at line 46
> 
> /* aCaB -- use Byte defined in zconf.h
> typedef unsigned char Byte;
> */
> 
> making these changes to the Types.h file with 0.98 enables the compile 
> to complete.
> 
> I have compiled 0.98 on CentOS6.4 without issues so this is probably 
> related to the gcc version or some such.

Just for the record/archives/Google: That has nothing to do with gcc,
the version or any C compiler. There are 2 typedef's for the same type
name and that is a bad thing in C.
They seem to come from 2 different packages but that doesn't matter.

If both (or all;-) are identical, it is a safe thing to comment n-1 out.
The #define as proposed above may lead to strange error messages -
especially if the #define is seen by the preprocessor before the
"typedef" ....

BTW the really cute solution if someone needs types with a defined size
(which is perfectly reasonable) is to #include <stdint.h> (which exists
since ages in the civilized world) and use int8_t, uint8_t and similar
instead of homegrown "byte", "Byte", "uchar" or others - see also
http://pubs.opengroup.org/onlinepubs/007904975/basedefs/stdint.h.html.

        Bernd
-- 
Bernd Petrovitsch                  Email : be...@petrovitsch.priv.at
                     LUGA : http://www.luga.at

_______________________________________________
Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq
http://www.clamav.net/support/ml

Reply via email to