Article View: gnu.g++.help
Article #534Mixing C and C++
From: pwang
Date: Fri, 19 Apr 1991 18:40
Date: Fri, 19 Apr 1991 18:40
19 lines
920 bytes
920 bytes
Our g++ compiler issues a warning after seeing the function name
``flock'' inside a extern "C" { ... }
and then seeing the
struct flock { ...
...
};
in the fctlcomm.h header file on the SUN.
The warning is
flock declared `extern' and now declared again as `static' ...
Question: Why is the second declaration of flock static? How in general
to avoid such name conflicts when including C/UNIX header files?
Thanks.
Technical Details
Message-ID:
<9104191840.AA01945@Monkey.mcs.kent.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!linac!att!ucbvax!tut.cis.ohio-state.edu!unreplyable!garbageShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!linac!att!ucbvax!tut.cis.ohio-state.edu!unreplyable!garbage From: pwang@MCS.KENT.EDU Newsgroups: gnu.g++.help,comp.lang.c++ Subject: Mixing C and C++ Message-ID: <9104191840.AA01945@Monkey.mcs.kent.edu> Date: 19 Apr 91 18:40:10 GMT Sender: daemon@tut.cis.ohio-state.edu Followup-To: gnu.g++.help Organization: Gatewayed from the GNU Project mailing list help-g++@prep.ai.mit.edu Lines: 19