Is there a complete list of behavior implemented in C ++?

I responded to a comment on my answer: Interview with C job - casting and comparing and found that I could not find a complete list of what C ++ considers "Implementation -Specific behavior. I know that there are 3 categories for this: behavior Undefined, implementation-defined behavior, and Unspecified behavior; however, most discussions focus on Undefined behavior, and when implementation-specific behavior is discussed, no more than one example is given.In general, I tend to write a lot of code that moves into this area, and i know what kind behavior is expected; however, I would like to be able to comment well on its validity.I would also like to throw in that, in my opinion, in the operations community there are many incorrect undefined diagnoses when they are really well defined by the platform.

Please note that I am not very interested in how this platform selects a definition of this behavior, but rather has a list of all actions that fall into the "Implemented" category, as defined by the C ++ standard.

+6
source share
1 answer

The standard itself defines all implementation cases defined during implementation, the draft C ++ standard has an Index of implementation-defined behavior at the end that provides topics and on which page this topic is solved, for example:

additional formats for time_get :: do_get_date, 689

76

alignment of additional values, 76

In fact, each compiler must document all the behavior defined by the implementation and how it is associated with them. For example, here is gcc C ++ Section with implementation definition and gcc C Implementation-defined behavior . As far as I know, the C ++ standard is not like a draft of the C99 standard, which gives a link to unspecified or undefined behavior. Therefore, you will have to resort to searching the document for undefined and unspecified to find all instances.

The draft C99 standard provides a reference for undefined, undefined, and implementation-specific behavior in Annex J.1 , J.2 and J.3 respectively.

It is important to note that undefined behavior can be defined as defined in the implementation, but they need to document it. In your specific example, it looks like you are violating the rules of strict alias rules , but your alternative suggestion to use the pint function is precisely defined with C89.

+9
source

All Articles