Re: Does g++ really need to compile main, if c++ code is involved?

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

 



On Thu, Mar 20, 2014 at 9:38 AM, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote:
>
> Global ctors/dtors are a separate issue, I'm not sure how they're
> handled if main() isn't written in C++.

It doesn't matter.  As a GCC extension, you can write a global
constructor in C using __attribute__ ((constructor)), and the result
is equivalent to a C++ global constructor.  It follows that if global
constructors work at all, they will work whether main is written in C
or C++.

Ian




[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