Re: C++ thingies
- From: Joaquin Cuenca Abela <cuenca ie2 u-psud fr>
- To: dave arsdigita com
- Cc: gnome-hackers gnome org
- Subject: Re: C++ thingies
- Date: Tue, 29 May 2001 23:10:26 +0200 (CEST)
On 29 May 2001 03:45:45 +0200, Drazen Kacar wrote:
>
> So, the question is: is that page correct about underscores and if so,
> shouldn't public headers be without functions named like that?
yes & yes
> It's perfectly possible that something like:
>
> extern "C" {
> void foo__bar(int);
> }
>
> is legal, but the page doesn't say anything about that option and I
don't
> know anything about C++, so here you go.
a nm of an object file of a project where I'm working right now shows:
...
000003d0 T create_2bits__9HistogramRC5Image
000009e0 T create__9HistogramRC5ImageRCQ29Histogram4Type
00000720 T create_gray__9HistogramRC5Image
...
Now, if I add a
extern "C" {
void create_2bits__9HistogramRC5Image(void) {
}
}
to the project (in the same, or in other compilation unit), the linker
will complain 'cause of the collision.
I don't need to explain the potential consequences of having such a
funcion in a public library for the C++ people (but anyway, you should
name your functions as a mad to actually collide with the compiler).
Cheers,
--
Joaqun Cuenca Abela
cuenca celium net
_______________________________________________
gnome-hackers mailing list
gnome-hackers gnome org
http://mail.gnome.org/mailman/listinfo/gnome-hackers
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]