{"id":4708,"date":"2024-04-21T20:29:08","date_gmt":"2024-04-21T18:29:08","guid":{"rendered":"https:\/\/mariusbancila.ro\/blog\/?p=4708"},"modified":"2024-04-21T20:29:11","modified_gmt":"2024-04-21T18:29:11","slug":"erroneous-behaviour-has-entered-the-chat","status":"publish","type":"post","link":"https:\/\/mariusbancila.ro\/blog\/2024\/04\/21\/erroneous-behaviour-has-entered-the-chat\/","title":{"rendered":"Erroneous behaviour has entered the chat"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The C++ language defines the observable behaviour of a program and uses terms such as <em>ill-formed<\/em> or <em>undefined behaviour<\/em> to describe it. The C++26 standard introduces a new one, called <em>erroneous behaviour<\/em>. In this post, we&#8217;ll look at what these terms mean.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Well-formed<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This is the simplest of them all. It means that a program is constructed according to the syntactic and semantic rules of the C++ language.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Ill-formed<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">By contrast, a program that is not well-formed, is called ill-formed. An ill-formed program is a program that has syntactic errors or semantic errors that compilers can diagnose. For such a program, the compiler is required to issue a diagnostic. Here are a couple of examples:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int main()\n{\n   int a = 42   \/\/ syntax error, missing ;\n}<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int main()\n{\n   int a = 42;\n\n   auto l = [a](int const a) {return a + 1;};  \/\/ error: lambda capture and lambda parameter have the same name\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">(Trivia: the term <em>ill-formed<\/em> is used about 500 times in the standard.)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Ill-formed, no diagnostic required<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This means the program is syntactically correct but has semantic errors, which might not be diagnosable. The compiler is not required to issue a diagnose and executing such a program is undefined behaviour. That doesn&#8217;t mean that the compilers do not diagnosticate these problems. In practice, many of these cases do get a diagnose. A couple examples are shown next:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class foo\n{\n   foo(int a) : foo(a + 1) {} \/\/ constructor delegates to itself\n};<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">float operator \"\"Z(const char*) \/\/ literal suffix identifiers that do not start with an underscore are reserved\n{ return 42; }<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">(Trivia: the term <em>ill-formed, no diagnostic required<\/em> appears about 50 times in the standard.)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Unspecified behaviour<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This term defines behaviour that is dependent on the implementation. Examples for such behaviour include the order of function parameter evaluation (which can be from left to right or from right to left) or the amount of memory overhead for an array allocation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation-defined behaviour<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Unspecified behaviour should not be confused with the <em>implementation-defined<\/em> behaviour. The difference between the two is actually small: in the case of implementation-defined behaviour, the effect of the bahaviour <em>must be documented<\/em>, which is not the case for unspecified behaviour.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Examples of implementation-defined behaviour include the choice of underlying type for the <code>char<\/code> type (which can be either <code>signed char<\/code> or <code>unsigned char<\/code>, although <code>char<\/code> is a distinct type) and the minimum number of buckets for constructing an <code>std::unordered_multiset<\/code> (when a value is not explicitly specified). Often, such implementation-defined choices are described with a comment such as following in the specification:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">unordered_multiset( std::initializer_list&lt;value_type> init,\n                    size_type bucket_count = \/* implementation-defined *\/,\n                    const Hash&amp; hash = Hash(),\n                    const key_equal&amp; equal = key_equal(),\n                    const Allocator&amp; alloc = Allocator() );<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">(Trivia: the term implementation-defined is used 400 times in the standard.)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Undefined behaviour<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This is one of the most known traits of the C++ language. For a range of cases that are semantically incorrect, the standard does not impose any restrictions on the behaviour, and does not require the compiler to diagnose the situation (even though compilers do that whenever they can detect such cases). This is called undefined behaviour. A program with undefined behaviour can execute normally, can crash, or can execute without doing anything that is expected without being incorrect. Examples of undefined behaviour include:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>dereferencing a null pointer<\/li><li>indexing an array out of bounds<\/li><li>converting between pointers to objects of incompatible types<\/li><li>overflow of signed integers<\/li><li>casting a numeric value to a type in which the value cannot be represented<\/li><li>modifying a constant object<\/li><li>division by zero (using <code>\/<\/code> or <code>%<\/code> operators)<\/li><li>reading uninitialized variables<\/li><\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int* i = nullptr;\nstd::cout &lt;&lt; *i &lt;&lt; '\\n'; \/\/ dereferencing a null pointer<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int a[5];\na[5] = 42; \/\/ indexing an array out of bounds<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int step_it(int a) {return a + 1;}\n\nint main()\n{\n  int x;\n  std::cout &lt;&lt; step_it(x) &lt;&lt; '\\n'; \/\/ uninitialized read\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">(Trivia: Undefined behaviour appears a bit more over 100 times in the standard.)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The standard specifies the following about undefined behaviour:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>3.65 [defns.undefined]<\/strong><\/p><p><strong>undefined behavior<\/strong><\/p><p>behavior for which this document imposes no requirements<\/p><p><em>[Note 1 to entry: Undefined behavior may be expected when this document omits any explicit definition of behavior or when a program uses an erroneous construct or erroneous data. [&#8230;] ]<\/em><\/p><cite>C++ Standard, N4917, paragraph 3.65<\/cite><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Erroneous behaviour<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The C++26 standard defines a new kind of behaviour known as erroneous behaviour. This is meant to define incorrect code of a well-formed program to indicate bugs and allow compilers to diagnose them. The paper <a href=\"https:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2024\/p2795r5.html\" target=\"_blank\" rel=\"noopener\" title=\"\">P2795R5, Erroneous behaviour for uninitialized reads<\/a>, by Thomas K\u00f6ppe, introduces this new behaviour for uninitialized reads (the last example in the previous section). This is defined as follows:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>3.?<\/strong><\/p><p><strong>erroneous behavior<\/strong><\/p><p>well-defined behavior that the implementation is recommended to diagnose<\/p><p><em>[Note 1 to entry: Erroneous behavior is always the consequence of incorrect program code. Implementations are allowed, but not required, to diagnose it ([4.1.1, intro.compliance.general]). Evaluation of a constant expression ([7.7, expr.const]) never exhibits behavior specified as erroneous in [4, intro] through [15, cpp]. \u2014 end note]<\/em><\/p><cite>P2795R5<\/cite><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">It also changes the definition of undefined bavariour to the following:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>3.65 [defns.undefined]<\/strong><\/p><p><strong>undefined behavior<\/strong><\/p><p>behavior for which this document imposes no requirements<\/p><p><em>[Note 1 to entry: Undefined behavior may be expected when this document omits any explicit definition of behavior or when a program uses an erroneous incorrect construct or erroneousinvalid data. [&#8230;] ]<\/em><\/p><cite>P2795R5<\/cite><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">In the future, other programming errors can be categorized as erroneous behaviour:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>signed integer overflow<\/li><li>array access out of bounds<\/li><li>dereferencing null pointers<\/li><li>type-punning (such as <code>reinterpret_cast<\/code>-ing a floating-point value to an integer value)<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Identifying undefined behaviour may have runtime costs. Therefore, users would be able to opt out of such a behaviour. This will be done with the help of an attribute. For uninitialized reads, this attribute is not yet defined (although the proposal is to use <code>[[indeterminate]]<\/code>), but will be usable on variable definitions and on function parameters.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int step_it(int a) {return a + 1;}\n\nint main()\n{\n  [[indeterminate]] int x;\n  std::cout &lt;&lt; step_it(x) &lt;&lt; '\\n'; \/\/ uninitialized read\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For more information about this, including motivation, implications, and examples, you should read the proposal paper, mentioned earlier.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The C++ language defines the observable behaviour of a program and uses terms such as ill-formed or undefined behaviour to describe it. The C++26 standard introduces a new one, called erroneous behaviour. In this post, we&#8217;ll look at what these terms mean. Well-formed This is the simplest of them all. It means that a program &#8230; <a title=\"Erroneous behaviour has entered the chat\" class=\"read-more\" href=\"https:\/\/mariusbancila.ro\/blog\/2024\/04\/21\/erroneous-behaviour-has-entered-the-chat\/\" aria-label=\"Read more about Erroneous behaviour has entered the chat\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[7],"tags":[451,647],"class_list":["post-4708","post","type-post","status-publish","format-standard","hentry","category-c","tag-c","tag-c26"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Marius Bancila\"\/>\n\t<meta name=\"keywords\" content=\"c++,c++26\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/mariusbancila.ro\/blog\/2024\/04\/21\/erroneous-behaviour-has-entered-the-chat\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Marius Bancila&#039;s Blog | About code. Mostly on C++\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Erroneous behaviour has entered the chat\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/mariusbancila.ro\/blog\/2024\/04\/21\/erroneous-behaviour-has-entered-the-chat\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2024-04-21T18:29:08+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2024-04-21T18:29:11+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Erroneous behaviour has entered the chat\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2024\\\/04\\\/21\\\/erroneous-behaviour-has-entered-the-chat\\\/#article\",\"name\":\"Erroneous behaviour has entered the chat\",\"headline\":\"Erroneous behaviour has entered the chat\",\"author\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\"},\"datePublished\":\"2024-04-21T20:29:08+02:00\",\"dateModified\":\"2024-04-21T20:29:11+02:00\",\"inLanguage\":\"en-US\",\"commentCount\":2,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2024\\\/04\\\/21\\\/erroneous-behaviour-has-entered-the-chat\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2024\\\/04\\\/21\\\/erroneous-behaviour-has-entered-the-chat\\\/#webpage\"},\"articleSection\":\"C++, C++, C++26\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2024\\\/04\\\/21\\\/erroneous-behaviour-has-entered-the-chat\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"name\":\"IT\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"position\":2,\"name\":\"IT\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"name\":\"Software\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"position\":3,\"name\":\"Software\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/#listItem\",\"name\":\"C++\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"name\":\"IT\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/#listItem\",\"position\":4,\"name\":\"C++\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2024\\\/04\\\/21\\\/erroneous-behaviour-has-entered-the-chat\\\/#listItem\",\"name\":\"Erroneous behaviour has entered the chat\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"name\":\"Software\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2024\\\/04\\\/21\\\/erroneous-behaviour-has-entered-the-chat\\\/#listItem\",\"position\":5,\"name\":\"Erroneous behaviour has entered the chat\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/#listItem\",\"name\":\"C++\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\",\"name\":\"Marius Bancila's Blog\",\"description\":\"About code. Mostly on C++\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/\",\"name\":\"Marius Bancila\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2024\\\/04\\\/21\\\/erroneous-behaviour-has-entered-the-chat\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a84dd2831d955c38355ddea55df4df260809b88f36408bc14fd4eab8f7f131c9?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Marius Bancila\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2024\\\/04\\\/21\\\/erroneous-behaviour-has-entered-the-chat\\\/#webpage\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2024\\\/04\\\/21\\\/erroneous-behaviour-has-entered-the-chat\\\/\",\"name\":\"Erroneous behaviour has entered the chat\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2024\\\/04\\\/21\\\/erroneous-behaviour-has-entered-the-chat\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"datePublished\":\"2024-04-21T20:29:08+02:00\",\"dateModified\":\"2024-04-21T20:29:11+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/\",\"name\":\"Marius Bancila's Blog\",\"description\":\"About code. Mostly on C++\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Erroneous behaviour has entered the chat","description":"","canonical_url":"https:\/\/mariusbancila.ro\/blog\/2024\/04\/21\/erroneous-behaviour-has-entered-the-chat\/","robots":"max-image-preview:large","keywords":"c++,c++26","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mariusbancila.ro\/blog\/2024\/04\/21\/erroneous-behaviour-has-entered-the-chat\/#article","name":"Erroneous behaviour has entered the chat","headline":"Erroneous behaviour has entered the chat","author":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"publisher":{"@id":"https:\/\/mariusbancila.ro\/blog\/#organization"},"datePublished":"2024-04-21T20:29:08+02:00","dateModified":"2024-04-21T20:29:11+02:00","inLanguage":"en-US","commentCount":2,"mainEntityOfPage":{"@id":"https:\/\/mariusbancila.ro\/blog\/2024\/04\/21\/erroneous-behaviour-has-entered-the-chat\/#webpage"},"isPartOf":{"@id":"https:\/\/mariusbancila.ro\/blog\/2024\/04\/21\/erroneous-behaviour-has-entered-the-chat\/#webpage"},"articleSection":"C++, C++, C++26"},{"@type":"BreadcrumbList","@id":"https:\/\/mariusbancila.ro\/blog\/2024\/04\/21\/erroneous-behaviour-has-entered-the-chat\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog#listItem","position":1,"name":"Home","item":"https:\/\/mariusbancila.ro\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","name":"IT"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","position":2,"name":"IT","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","name":"Software"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","position":3,"name":"Software","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/#listItem","name":"C++"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","name":"IT"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/#listItem","position":4,"name":"C++","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/2024\/04\/21\/erroneous-behaviour-has-entered-the-chat\/#listItem","name":"Erroneous behaviour has entered the chat"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","name":"Software"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/2024\/04\/21\/erroneous-behaviour-has-entered-the-chat\/#listItem","position":5,"name":"Erroneous behaviour has entered the chat","previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/#listItem","name":"C++"}}]},{"@type":"Organization","@id":"https:\/\/mariusbancila.ro\/blog\/#organization","name":"Marius Bancila's Blog","description":"About code. Mostly on C++","url":"https:\/\/mariusbancila.ro\/blog\/"},{"@type":"Person","@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author","url":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/","name":"Marius Bancila","image":{"@type":"ImageObject","@id":"https:\/\/mariusbancila.ro\/blog\/2024\/04\/21\/erroneous-behaviour-has-entered-the-chat\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/a84dd2831d955c38355ddea55df4df260809b88f36408bc14fd4eab8f7f131c9?s=96&d=mm&r=g","width":96,"height":96,"caption":"Marius Bancila"}},{"@type":"WebPage","@id":"https:\/\/mariusbancila.ro\/blog\/2024\/04\/21\/erroneous-behaviour-has-entered-the-chat\/#webpage","url":"https:\/\/mariusbancila.ro\/blog\/2024\/04\/21\/erroneous-behaviour-has-entered-the-chat\/","name":"Erroneous behaviour has entered the chat","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/mariusbancila.ro\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/mariusbancila.ro\/blog\/2024\/04\/21\/erroneous-behaviour-has-entered-the-chat\/#breadcrumblist"},"author":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"creator":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"datePublished":"2024-04-21T20:29:08+02:00","dateModified":"2024-04-21T20:29:11+02:00"},{"@type":"WebSite","@id":"https:\/\/mariusbancila.ro\/blog\/#website","url":"https:\/\/mariusbancila.ro\/blog\/","name":"Marius Bancila's Blog","description":"About code. Mostly on C++","inLanguage":"en-US","publisher":{"@id":"https:\/\/mariusbancila.ro\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Marius Bancila's Blog | About code. Mostly on C++","og:type":"article","og:title":"Erroneous behaviour has entered the chat","og:url":"https:\/\/mariusbancila.ro\/blog\/2024\/04\/21\/erroneous-behaviour-has-entered-the-chat\/","article:published_time":"2024-04-21T18:29:08+00:00","article:modified_time":"2024-04-21T18:29:11+00:00","twitter:card":"summary","twitter:title":"Erroneous behaviour has entered the chat"},"aioseo_meta_data":{"post_id":"4708","title":null,"description":null,"keywords":[],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2024-04-19 06:35:28","updated":"2025-12-12 07:58:44","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"author_meta":{"display_name":"Marius Bancila","author_link":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/"},"featured_img":null,"jetpack_publicize_connections":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Marius Bancila","author_link":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/"},"uagb_comment_info":2,"uagb_excerpt":"The C++ language defines the observable behaviour of a program and uses terms such as ill-formed or undefined behaviour to describe it. The C++26 standard introduces a new one, called erroneous behaviour. In this post, we&#8217;ll look at what these terms mean. Well-formed This is the simplest of them all. It means that a program&hellip;","coauthors":[],"tax_additional":{"categories":{"linked":["<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/\" class=\"advgb-post-tax-term\">C++<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">C++<\/span>"]},"tags":{"linked":["<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/\" class=\"advgb-post-tax-term\">C++<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/\" class=\"advgb-post-tax-term\">C++26<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">C++<\/span>","<span class=\"advgb-post-tax-term\">C++26<\/span>"]}},"comment_count":"2","relative_dates":{"created":"Posted 2 years ago","modified":"Updated 2 years ago"},"absolute_dates":{"created":"Posted on April 21, 2024","modified":"Updated on April 21, 2024"},"absolute_dates_time":{"created":"Posted on April 21, 2024 8:29 pm","modified":"Updated on April 21, 2024 8:29 pm"},"featured_img_caption":"","series_order":"","jetpack_shortlink":"https:\/\/wp.me\/pYNdv-1dW","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/4708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/comments?post=4708"}],"version-history":[{"count":14,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/4708\/revisions"}],"predecessor-version":[{"id":4722,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/4708\/revisions\/4722"}],"wp:attachment":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/media?parent=4708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/categories?post=4708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/tags?post=4708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}