public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* a g++ problem about the order of object files needed to link
@ 2018-06-12  8:25 刘超杰
  2018-06-12 16:22 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: 刘超杰 @ 2018-06-12  8:25 UTC (permalink / raw)
  To: gcc

Hi:
When I was using g++, I found a problem, maybe which is a bug or not. It is about the order of object files needed to link, if you change the order of files, the result is different. I can duplicate the problem, and I have write an example, whose git address is: https://github.com/Erician/problems/tree/master/cpp/obj_order. If you know why, please tell me. Thanks.


Eric Liu
Wuhan, China

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: a g++ problem about the order of object files needed to link
  2018-06-12  8:25 a g++ problem about the order of object files needed to link 刘超杰
@ 2018-06-12 16:22 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2018-06-12 16:22 UTC (permalink / raw)
  To: 刘超杰; +Cc: gcc

On 12 June 2018 at 06:49, 刘超杰 wrote:
> Hi:
> When I was using g++, I found a problem, maybe which is a bug or not.

This is the wrong mailing list for your question. Please use the
gcc-help@gcc.gnu.org list for help and questions about GCC.


> It is about the order of object files needed to link, if you change the order of files, the result is different. I can duplicate the problem, and I have write an example, whose git address is: https://github.com/Erician/problems/tree/master/cpp/obj_order. If you know why, please tell me. Thanks.

This is an unfortunate property of how C++ works, see
https://isocpp.org/wiki/faq/ctors#static-init-order

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-12  8:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-12  8:25 a g++ problem about the order of object files needed to link 刘超杰
2018-06-12 16:22 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).