Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8505733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:24:13+00:00 2026-06-11T02:24:13+00:00

C++03 Standard [basic.start.init] point 3 states: It is implementation-defined whether or not the dynamic

  • 0

C++03 Standard [basic.start.init] point 3 states:

It is implementation-defined whether or not the dynamic
initialization (8.5, 9.4, 12.1, 12.6.1) of an object of namespace
scope is done before the first statement of main. If the
initialization is deferred to some point in time after the first
statement of main, it shall occur before the first use of any
function or object defined in the same translation unit as the
object to be initialized.

Microsoft Compilers, according to Additional Startup Considerations, perform the initialization prior to main().

I have been unable to obtain documentation stating the behaviour for GNU and Sun Forte compilers.

Can anyone:

  1. Point me in the direction of documentation that describes the behaviour of the GNU and Forte compilers with respect to dynamic initialization (I have checked the GCC manual and found nothing relating to dynamic initialization).
  2. Comment on the thread-safety of deferred dynamic initialization (if two threads attempt to invoke a function from the same translation unit that contains a non-local object).

FWIW, I observed the behaviour of GNU’s g++ and SUN’s CC and both performed the initalization prior to main though I don’t accept this as a definitive answer. (I can post the very simple code I used to observe if anyone is interested but I felt the question is long enough)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:24:15+00:00Added an answer on June 11, 2026 at 2:24 am

    The definitive answer is that all compilers do static initialization
    before main, unless the objects are in a DLL which is loaded later.
    In practice, it’s (almost) impossible to meet the requirements in the
    text you cite otherwise. (Think of what happens if there is a cycle.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Standard Java does not offer an object implementing the Queue interface on top of
I'm not sure if I'm using standard terms, but this is a basic OO
The reason? Pure nostalgia. Anyway, there was a standard for Basic that was published
I have a basic asp.net webform that handles events via standard postback. On this
standard power operation ( ** ) in Python does not work for negative power!
The standard explicitly states that main has two valid (i.e., guaranteed to work) signatures;
I am creating a basic CMS website using Alfresco Web Quick Start. I want
Before I start, please forget my ignorance when it comes to MIME and basic
I am interested in building a standard/basic email application where people can log in
Im trying to make a basic shape ( Hexigon ) to start and learn

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.