NetBSD Problem Report #40959

From www@NetBSD.org  Wed Mar  4 11:03:58 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 936A063BD3B
	for <gnats-bugs@gnats.netbsd.org>; Wed,  4 Mar 2009 11:03:58 +0000 (UTC)
Message-Id: <20090304110358.2593763BAB8@www.NetBSD.org>
Date: Wed,  4 Mar 2009 11:03:58 +0000 (UTC)
From: joern.clausen@uni-bielefeld.de
Reply-To: joern.clausen@uni-bielefeld.de
To: gnats-bugs@NetBSD.org
Subject: security/mhash with Sun Studio Compiler
X-Send-Pr-Version: www-1.0

>Number:         40959
>Category:       pkg
>Synopsis:       security/mhash with Sun Studio Compiler
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 04 11:05:00 +0000 2009
>Originator:     Jörn Clausen
>Release:        
>Organization:
University of Bielefeld
>Environment:
SunOS opensolaris 5.11 snv_101b i86pc i386 i86pc

>Description:
security/mhash does not compile with Sun Studio Compiler.
>How-To-Repeat:

>Fix:
One case of a void function returning an int:

--- lib/stdfns.c.orig   2009-03-04 02:04:19.075011426 -0800
+++ lib/stdfns.c
@@ -222,7 +222,8 @@ mutils_memcpy(void *dest, __const void *
        if ((n < 16) || ((mutils_word32)ptr1 & 0x3) || ((mutils_word32)ptr2 
 & 0x3))
        {
-               return mutils_memcpy8(ptr2, ptr1, n);
+               mutils_memcpy8(ptr2, ptr1, n);
+               return;
        }

        words = n >> 2;

Note that this has been fixed in the current version 0.9.9.9 of mhash.

And this definition of __const is not caught:

--- include/mutils/mutils.h.orig        2009-03-04 02:04:19.069664077 -0800
+++ include/mutils/mutils.h
@@ -23,7 +23,7 @@

 #include <mutils/mincludes.h>

-#if defined(const)
+#if defined(const) || (defined(sun) && !defined(__GNUC__))
 #define __const const
 #endif 

I'm not sure if one should also check for "__sun__", but this patch works both with Sun Studio and GCC. This patch has been sent to mhash developer list, but awaits approval.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.