From nobody@FreeBSD.org  Fri Feb  1 12:14:34 2002
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 8023237B41B
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  1 Feb 2002 12:14:33 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.6/8.11.6) id g11KEXw80582;
	Fri, 1 Feb 2002 12:14:33 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200202012014.g11KEXw80582@freefall.freebsd.org>
Date: Fri, 1 Feb 2002 12:14:33 -0800 (PST)
From: Frank Dabek <fdabek@mit.edu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: mp_set_memory_functions not extern "C"'d in gmp.h
X-Send-Pr-Version: www-1.0

>Number:         34538
>Category:       gnu
>Synopsis:       mp_set_memory_functions not extern "C"'d in gmp.h
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 01 12:20:01 PST 2002
>Closed-Date:    Sun Sep 11 16:50:12 GMT 2005
>Last-Modified:  Sun Sep 11 16:50:12 GMT 2005
>Originator:     Frank Dabek
>Release:        4.5 stable
>Organization:
LCS
>Environment:
uname -a
FreeBSD supervised-residence.lcs.mit.edu 4.5-RELEASE FreeBSD 4.5-RELEASE #1: Thu Jan 31 13:36:23 EST 2002     rtm@frenulum.lcs.mit.edu:/usr/src/sys/compile/PDOS-UNI  i386

>Description:
At line 171 (or so) in /usr/include/gmp.h,

void mp_set_memory_functions _PROTO ((void *(*) (size_t),
                                      void *(*) (void *, size_t, size_t),
                                      void (*) (void *, size_t)));

is not included in the extern "C" { 
declaration of line 177 (or so)

This makes it impossible to link C++ programs which use this function.

>How-To-Repeat:
use mp_set_memory_functions in a C++ program and link it against libgmp.a.
The linker will report mp_set_memory_functions as an unresolved symbol (since C++ is mangling its name)
>Fix:
move mp_set_memory_functions into the extern "C"
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->suspended 
State-Changed-By: kris 
State-Changed-When: Sat Jul 12 22:46:28 PDT 2003 
State-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=34538 
State-Changed-From-To: suspended->open 
State-Changed-By: kris 
State-Changed-When: Sat Jul 12 22:47:06 PDT 2003 
State-Changed-Why:  
Suspended in error 

http://www.freebsd.org/cgi/query-pr.cgi?pr=34538 
State-Changed-From-To: open->closed 
State-Changed-By: rodrigc 
State-Changed-When: Sun Sep 11 16:43:37 GMT 2005 
State-Changed-Why:  
libgmp and gmp.h are no longer in the base system. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=34538 
>Unformatted:
