🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1038

Problem with extern "C" function

#1038
From: Kevin R. Talbot
Date: Thu, 08 Oct 1992 19:27
26 lines
1529 bytes
The following program gives an incorrect error message:

extern "C" int foo(char *, char *);

void
Bar(char *name)
{
    char *namelist;
    (void)foo(name, &namelist);     // Problem with the _second_ argument.
}

Compiled with: g++ -v -c test.cc

Gives the following error:

Reading specs from /usr/sab/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/specs
gcc version 2.2.2
 /usr/sab/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix test.cc /usr/tmp/cca07543.i
GNU CPP version 2.2.2 (sparc)
 /usr/sab/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/cc1plus /usr/tmp/cca07543.i -quiet -dumpbase test.cc -version -o /usr/tmp/cca07543.s
GNU C++ version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
test.cc: In function `void  Bar (char *)':
test.cc:7: incompatible pointer types for argument 1 of `int  foo (char *, char *)'

My e-mail address is krt@edsr.eds.com
-Kevin
Technical Details
Message-ID: <1435@helena.edsr.eds.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!edsr.UUCP!krt

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!edsr.UUCP!krt
From: krt@edsr.UUCP (Kevin R. Talbot)
Subject: Problem with extern "C" function
Message-ID: <1435@helena.edsr.eds.com>
Summary: Faulty error message on extern "C" function
Sender: gnulists@ai.mit.edu
Reply-To: edsr!krt@uunet.uu.net
Organization: Electronic Data Systems
Distribution: gnu
Date: Thu, 8 Oct 1992 19:27:51 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 28