From nobody@FreeBSD.org  Tue Jul  9 21:25:55 2002
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D619337B400
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  9 Jul 2002 21:25:55 -0700 (PDT)
Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 582BE43E3B
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  9 Jul 2002 21:25:55 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.4/8.12.4) with ESMTP id g6A4PtOT001791
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 9 Jul 2002 21:25:55 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.4/8.12.4/Submit) id g6A4PtD6001790;
	Tue, 9 Jul 2002 21:25:55 -0700 (PDT)
Message-Id: <200207100425.g6A4PtD6001790@www.freebsd.org>
Date: Tue, 9 Jul 2002 21:25:55 -0700 (PDT)
From: Cloudy Zheng <jedizh@sina.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: missing extern "C" in fetch.h
X-Send-Pr-Version: www-1.0

>Number:         40399
>Category:       misc
>Synopsis:       missing extern "C" in fetch.h
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 09 21:30:01 PDT 2002
>Closed-Date:    Fri Jul 26 04:11:16 PDT 2002
>Last-Modified:  Fri Jul 26 04:11:16 PDT 2002
>Originator:     Cloudy Zheng
>Release:        4.6
>Organization:
>Environment:
FreeBSD beastie.netease.com 4.6-RELEASE FreeBSD 4.6-RELEASE #0: Tue Jun 18 18:30:48 CST 2002     root@beastie.netease.com:/usr/src/sys/compile/BEASTIE  i386
>Description:
      No extern "C" declare in fetch.h, cannot link against C++ code
>How-To-Repeat:
//foo.cpp
#include <sys/param.h>
#include <stdio.h>
#include <fetch.h>
int main()
{
  struct url *p=fetchParseURL("http://somesite/somedoc");
}

$g++ -ofoo foo.cpp -lfetch
..
..:undefined reference to `fetchParseURL(char const *)
>Fix:
fetch.patch:
39a40,43
> #ifdef __cplusplus
> extern "C" {
> #endif
>     
141c145,147
< 
---
> #ifdef __cplusplus
> }
> #endif
>Release-Note:
>Audit-Trail:

From: Giorgos Keramidas <keramida@FreeBSD.org>
To: Cloudy Zheng <jedizh@sina.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: misc/40399: missing extern "C" in fetch.h
Date: Wed, 10 Jul 2002 21:51:51 +0300

 On 2002-07-09 21:25 +0000, Cloudy Zheng wrote:
 > No extern "C" declare in fetch.h, cannot link against C++ code[...]
 
 I'm not sure it's a nice idea to "pollute" all the headers of the base
 system with `extern "C" { ... }' blocks.  It's the responsibility of
 the one that wants to include C headers within C++ programs to add the
 proper `extern' blocks to the programs, IMHO.
 
Responsible-Changed-From-To: freebsd-bugs->des 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Wed Jul 17 16:07:32 PDT 2002 
Responsible-Changed-Why:  
DES is probably the best man to decide if fetch.h needs 
__BEGIN_DECLS lines. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40399 
State-Changed-From-To: open->closed 
State-Changed-By: des 
State-Changed-When: Fri Jul 26 04:11:14 PDT 2002 
State-Changed-Why:  
Fixed, thanks. 

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