The C ++ standard comes with an amazing amount of definitions for fuzzy behavior 1 which means more or less the same with subtle differences. Reading this answer , I noticed that the wording "the program is poorly formed, no diagnostics are required."
Defined by the implementation differs from unspecified behavior in that the implementation in the first case should clearly document what it is doing (in the latter case it is not necessary), both of them are well-formed. Undefined behavior differs from unspecified in that the program is erroneous (1.3.13).
Otherwise, everyone has in common that the standard makes no assumptions or requirements as to what the implementation will do. With the exception of 1.4 / 8, which states that implementations can have extensions that do not change the behavior of well-formed programs, but are poorly formed in accordance with the standard, and the implementation should diagnose the use of these, but can subsequently continue compiling and executing the poorly-formed program.
A poorly formed program is otherwise defined as informal (excellent!). On the other hand, a well-formed program is defined as one that adheres to syntactic and diagnosable semantic rules. This, therefore, means that an incorrect program is one that breaks down either syntactic or semantic rules (or both). In other words, an incorrect program should not actually be compiled at all (how can one translate, for example, a program with incorrect syntax in any meaningful way?).
I would be inclined to think that the word âerroneousâ also implies that the compiler must abort the assembly with an error message (in the end, it erroneously assumes an error), but the âNoteâ section in 1.3.13 explicitly allows something else including silently ignoring the problem (and compilers obviously do not break the build due to UB, most do not even warn by default).
It can also be assumed that the erroneous and poorly formed are the same, but the standard does not go into details if this is so, or what this word should mean.
Further, 1.4 states that
the appropriate implementation should [...] accept and correctly execute a well-formed program
and
If a program contains a violation of a rule that does not require diagnostics, [...] there are no implementation requirements for this program.
In other words, the corresponding implementation must accept a well-formed program, but it can also accept a poorly formed program, even without warning. In addition, if the program is poorly formed because it uses the extension.
The second paragraph says that anything combined with âno diagnosis neededâ means that the specification has no requirements, which means that it is basically equivalent to âundefined behaviorâ, except that the mention of the erroneous is not mentioned.
What would be the intention to use a wording such as âpoorly formed, not requiring diagnosisâ?
The presence of âno diagnosisâ suggests that it is identical (or basically identical?) To undefined behavior. In addition, since behavior defined by implementation and vague is defined as well-formed, it must be something else.
On the other hand, since an incorrect program violates syntactic / semantic rules, it should not actually compile. Which, however, combined with the âlack of the need for diagnosticsâ would mean that the compiler would be allowed to silently exit without warning, and after that you wonât be able to find the executable.
Is there a difference between âpoorly formed, lack of diagnosticsâ and âundefined behaviorâ, or is it just a complex synonym for the same thing?
1 In the absence of better wording for collective behavior