I'm trying to get 0.53 to compile on Solaris with Sun's compiler... and
I've run into some quirky gcc stuff in the code that the Sun C compiler
doesn't understand:

The first is the use of "__alignof__" in libclamav/md5.c:

*** md5.c_orig  Wed Nov 13 11:17:24 2002
--- md5.c       Wed Nov 13 11:22:42 2002
***************
*** 220,226 ****
--- 220,230 ----
        size_t add = 128 - left_over > len ? len : 128 - left_over;

        /* Only put full words in the buffer.  */
+ #if defined(__SUNPRO_C)
+       add -= add % 4;
+ #else
        add -= add % __alignof__ (md5_uint32);
+ #endif

        memcpy (&ctx->buffer[left_over], buffer, add);
        ctx->buflen += add;

Does the above fix look reasonable for Sun/SPARC?

The other case is in libclamav/md5.h:

*** md5.h_orig  Wed Nov 13 11:08:29 2002
--- md5.h       Wed Nov 13 11:16:01 2002
***************
*** 87,93 ****

    md5_uint32 total[2];
    md5_uint32 buflen;
! #ifdef C_DARWIN
    char buffer[128];
  #else
    char buffer[128] __attribute__ ((__aligned__ (__alignof__
(md5_uint32))));
--- 87,93 ----

    md5_uint32 total[2];
    md5_uint32 buflen;
! #if defined(C_DARWIN) || defined(__SUNPRO_C)
    char buffer[128];
  #else
    char buffer[128] __attribute__ ((__aligned__ (__alignof__
(md5_uint32))));


I just made it use the C_DARWIN section (no attrs) if we detect the Sun C
compiler.

Do these changes seem reasonable?

Also, clamscan/Makefile.in sets "-Wall" even when gcc is not being used.

Thanks,

        Ed

Ed Phillips <[EMAIL PROTECTED]> University of Delaware (302) 831-6082
Systems Programmer III, Network and Systems Services
finger -l [EMAIL PROTECTED] for PGP public key


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Reply via email to