Re: extern c in cpp file`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Yamin,

The  consequences of declaring a function as extern "C" are...

1) the name will be mangled according to your platform's C mangling convention*.
2) I recall (and I may be mistaken) that such a function acts as a "C barrier", and thus exceptions do not propagate through such a function.

Merely specifying the header declaration (prototype) as an extern "C" is good enough for the translation unit's definition (implementation) to use the C specification.

HTH,
--Eljay

* some C mangling conventions (depending on platform)...

1) convert to uppercase (ala Pascal)
2) prefix a leading underscore
3) leave the identifier as given.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux