>Number: 1289
>Category: bin
>Synopsis: errno breaks in thread-safe c++ compiles
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Jun 3 17:20:01 PDT 1996
>Last-Modified:
>Originator: Steve Passe
>Organization:
New Ideas
>Release: FreeBSD 2.2-960501-SNAP i386
>Environment:
FreeBSD 2.2-960501-SNAP, thread safe libc_r
>Description:
In the thread-safe libc, specifically errno.h, there is a
mechanism for using a unique copy of errno for each thread.
This mechanism breaks when a progam compliled under c++
uses errno (includes errno.h)
>How-To-Repeat:
foo.cc:
#include <errno.h>
cerr << "problem: " << errno << '\n';
g++ foo.cc:
(mumbles about unresolvedfunction "__error__Fv")
>Fix:
RCS file: RCS/errno.h,v
retrieving revision 1.1
diff -r1.1 errno.h
47c47,49
< extern int * __error();
---
> __BEGIN_DECLS
> int * __error __P((void));
> __END_DECLS
>Audit-Trail:
>Unformatted: