[{"data":1,"prerenderedAt":4024},["ShallowReactive",2],{"global-navigation":3,"page-\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp54-cpp":28,"surround-\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp54-cpp":3326,"sidebar-sei-cert-cpp-coding-standard":3333},[4,8],{"title":5,"path":6,"_path":6,"fromAppConfig":7},"Home","\u002F",true,{"title":9,"path":10,"children":11,"_path":27,"fromAppConfig":7},"Coding Standards","\u002Fcoding-standards\u002F",[12,15,18,21,24],{"title":13,"path":14},"Android Coding Standard","\u002Fandroid-secure-coding-standard\u002F",{"title":16,"path":17},"C Coding Standard","\u002Fsei-cert-c-coding-standard\u002F",{"title":19,"path":20},"C++ Coding Standard","\u002Fsei-cert-cpp-coding-standard\u002F",{"title":22,"path":23},"Java Coding Standard","\u002Fsei-cert-oracle-coding-standard-for-java\u002F",{"title":25,"path":26},"Perl Coding Standard","\u002Fsei-cert-perl-coding-standard\u002F","\u002Fcoding-standards",{"id":29,"title":30,"body":31,"description":3310,"extension":3311,"meta":3312,"navigation":7,"path":3322,"seo":3323,"stem":3324,"__hash__":3325},"content\u002F5.sei-cert-cpp-coding-standard\u002F3.rules\u002F07.expressions-exp\u002F06.exp54-cpp.md","EXP54-CPP. Do not access an object outside of its lifetime",{"type":32,"value":33,"toc":3286},"minimark",[34,38,48,56,119,122,145,148,153,158,254,258,264,344,351,354,359,520,530,533,543,678,681,697,809,812,815,824,925,928,944,960,1134,1137,1147,1288,1291,1304,1428,1431,1447,1554,1557,1574,1738,1741,1747,1878,1881,1905,2343,2348,2357,2467,2477,2485,2498,2530,2536,2548,2598,2602,2605,2670,2674,3165,3169,3183,3187,3212,3216,3258,3261,3282],[35,36,30],"h1",{"id":37},"exp54-cpp-do-not-access-an-object-outside-of-its-lifetime",[39,40,41,42,47],"p",{},"Every object has a lifetime in which it can be used in a well-defined manner. The lifetime of an object begins when sufficient, properly aligned storage has been obtained for it and its initialization is complete. The lifetime of an object ends when a nontrivial destructor, if any, is called for the object and the storage for the object has been reused or released. Use of an object, or a pointer to an object, outside of its lifetime frequently results in ",[43,44,46],"a",{"href":45},"\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fbb-definitions#BB.Definitions-undefinedbehavior","undefined behavior"," .",[39,49,50,51,55],{},"The C++ Standard, [basic.life], paragraph 5 [ ",[43,52,54],{"href":53},"\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Faa-bibliography#AA.Bibliography-ISO\u002FIEC14882-2014","ISO\u002FIEC 14882-2014"," ], describes the lifetime rules for pointers:",[57,58,59],"blockquote",{},[39,60,61,62,66,67,70,71,75,76,78,79,81,82,84,85,88,89,92,93,96,97,92,99,101,102,92,104,107,108,92,110,113,114,84,116,47],{},"Before the lifetime of an object has started but after the storage which the object will occupy has been allocated or, after the lifetime of an object has ended and before the storage which the object occupied is reused or released, any pointer that refers to the storage location where the object will be or was located may be used but only in limited ways. For an object under construction or destruction, see 12.7. Otherwise, such a pointer refers to allocated storage, and using the pointer as if the pointer were of type ",[63,64,65],"code",{},"void*"," , is well-defined. Indirection through such a pointer is permitted but the resulting lvalue may only be used in limited ways, as described below. The program has undefined behavior if:",[68,69],"br",{},"\n— the object will be or was of a class type with a non-trivial destructor and the pointer is used as the operand of a ",[72,73,74],"em",{},"delete-expression"," ,",[68,77],{},"\n— the pointer is used to access a non-static data member or call a non-static member function of the object, or",[68,80],{},"\n— the pointer is implicitly converted to a pointer to a virtual base class, or",[68,83],{},"\n— the pointer is used as the operand of a ",[63,86,87],{},"static_cast"," , except when the conversion is to pointer to ",[72,90,91],{},"cv"," ",[63,94,95],{},"void"," , or to pointer to ",[72,98,91],{},[63,100,95],{}," and subsequently to pointer to either ",[72,103,91],{},[63,105,106],{},"char"," or ",[72,109,91],{},[63,111,112],{},"   unsigned char  "," , or",[68,115],{},[63,117,118],{},"dynamic_cast",[39,120,121],{},"Paragraph 6 describes the lifetime rules for non-pointers:",[57,123,124],{},[39,125,126,127,129,130,132,133,135,136,138,139,141,142,47],{},"Similarly, before the lifetime of an object has started but after the storage which the object will occupy has been allocated or, after the lifetime of an object has ended and before the storage which the object occupied is reused or released, any glvalue that refers to the original object may be used but only in limited ways. For an object under construction or destruction, see 12.7. Otherwise, such a glvalue refers to allocated storage, and using the properties of the glvalue that do not depend on its value is well-defined. The program has undefined behavior if:",[68,128],{},"\n— an lvalue-to-rvalue conversion is applied to such a glvalue,",[68,131],{},"\n— the glvalue is used to access a non-static data member or call a non-static member function of the object, or",[68,134],{},"\n— the glvalue is bound to a reference to a virtual base class, or",[68,137],{},"\n— the glvalue is used as the operand of a ",[63,140,118],{}," or as the operand of ",[63,143,144],{},"typeid",[39,146,147],{},"Do not use an object outside of its lifetime, except in the ways described above as being well-defined.",[149,150,152],"h2",{"id":151},"noncompliant-code-example","Noncompliant Code Example",[39,154,155,156,47],{},"In this noncompliant code example, a pointer to an object is used to call a non-static member function of the object prior to the beginning of the pointer's lifetime, resulting in ",[43,157,46],{"href":45},[159,160,162],"code-block",{"quality":161},"bad",[163,164,169],"pre",{"className":165,"code":166,"language":167,"meta":168,"style":168},"language-cpp shiki shiki-themes github-light github-dark monokai","struct S {\n  void mem_fn();\n};\n \nvoid f() {\n  S *s;\n  s->mem_fn();\n}\n","cpp","",[63,170,171,188,201,207,213,224,237,248],{"__ignoreMap":168},[172,173,176,180,184],"span",{"class":174,"line":175},"line",1,[172,177,179],{"class":178},"sq6CD","struct",[172,181,183],{"class":182},"sz2Vg"," S",[172,185,187],{"class":186},"sMOD_"," {\n",[172,189,191,194,198],{"class":174,"line":190},2,[172,192,193],{"class":178},"  void",[172,195,197],{"class":196},"srTi1"," mem_fn",[172,199,200],{"class":186},"();\n",[172,202,204],{"class":174,"line":203},3,[172,205,206],{"class":186},"};\n",[172,208,210],{"class":174,"line":209},4,[172,211,212],{"class":186}," \n",[172,214,216,218,221],{"class":174,"line":215},5,[172,217,95],{"class":178},[172,219,220],{"class":196}," f",[172,222,223],{"class":186},"() {\n",[172,225,227,230,234],{"class":174,"line":226},6,[172,228,229],{"class":186},"  S ",[172,231,233],{"class":232},"sC2Qs","*",[172,235,236],{"class":186},"s;\n",[172,238,240,243,246],{"class":174,"line":239},7,[172,241,242],{"class":186},"  s->",[172,244,245],{"class":196},"mem_fn",[172,247,200],{"class":186},[172,249,251],{"class":174,"line":250},8,[172,252,253],{"class":186},"}\n",[149,255,257],{"id":256},"compliant-solution","Compliant Solution",[39,259,260,261],{},"In this compliant solution, storage is obtained for the pointer prior to calling ",[63,262,263],{},"S::mem_fn().",[159,265,267],{"quality":266},"good",[163,268,270],{"className":165,"code":269,"language":167,"meta":168,"style":168},"struct S {\n  void mem_fn();\n};\n \nvoid f() {\n  S *s = new S;\n  s->mem_fn();\n  delete s;\n}\n",[63,271,272,280,288,292,297,305,323,331,339],{"__ignoreMap":168},[172,273,274,276,278],{"class":174,"line":175},[172,275,179],{"class":178},[172,277,183],{"class":182},[172,279,187],{"class":186},[172,281,282,284,286],{"class":174,"line":190},[172,283,193],{"class":178},[172,285,197],{"class":196},[172,287,200],{"class":186},[172,289,290],{"class":174,"line":203},[172,291,206],{"class":186},[172,293,294],{"class":174,"line":209},[172,295,296],{"class":186}," \n",[172,298,299,301,303],{"class":174,"line":215},[172,300,95],{"class":178},[172,302,220],{"class":196},[172,304,223],{"class":186},[172,306,307,309,311,314,317,320],{"class":174,"line":226},[172,308,229],{"class":186},[172,310,233],{"class":232},[172,312,313],{"class":186},"s ",[172,315,316],{"class":232},"=",[172,318,319],{"class":232}," new",[172,321,322],{"class":186}," S;\n",[172,324,325,327,329],{"class":174,"line":239},[172,326,242],{"class":186},[172,328,245],{"class":196},[172,330,200],{"class":186},[172,332,333,336],{"class":174,"line":250},[172,334,335],{"class":232},"  delete",[172,337,338],{"class":186}," s;\n",[172,340,342],{"class":174,"line":341},9,[172,343,253],{"class":186},[39,345,346,347,350],{},"An improved compliant solution would not dynamically allocate memory directly but would instead use an automatic local variable to obtain the storage and perform initialization. If a pointer were required, use of a smart pointer, such as ",[63,348,349],{},"std::unique_ptr"," , would be a marked improvement. However, these suggested compliant solutions would distract from the lifetime demonstration of this compliant solution and consequently are not shown.",[149,352,152],{"id":353},"noncompliant-code-example-1",[39,355,356,357,47],{},"In this noncompliant code example, a pointer to an object is implicitly converted to a virtual base class after the object's lifetime has ended, resulting in ",[43,358,46],{"href":45},[159,360,361],{"quality":161},[163,362,364],{"className":165,"code":363,"language":167,"meta":168,"style":168},"struct B {};\n \nstruct D1 : virtual B {};\nstruct D2 : virtual B {};\n \nstruct S : D1, D2 {};\n \nvoid f(const B *b) {}\n \nvoid g() {\n  S *s = new S;\n  \u002F\u002F Use s\n  delete s;\n \n  f(s);\n}\n",[63,365,366,376,380,397,412,416,430,434,458,462,472,487,494,501,506,515],{"__ignoreMap":168},[172,367,368,370,373],{"class":174,"line":175},[172,369,179],{"class":178},[172,371,372],{"class":182}," B",[172,374,375],{"class":186}," {};\n",[172,377,378],{"class":174,"line":190},[172,379,212],{"class":186},[172,381,382,384,387,390,393,395],{"class":174,"line":203},[172,383,179],{"class":178},[172,385,386],{"class":182}," D1",[172,388,389],{"class":186}," : ",[172,391,392],{"class":178},"virtual",[172,394,372],{"class":182},[172,396,375],{"class":186},[172,398,399,401,404,406,408,410],{"class":174,"line":209},[172,400,179],{"class":178},[172,402,403],{"class":182}," D2",[172,405,389],{"class":186},[172,407,392],{"class":178},[172,409,372],{"class":182},[172,411,375],{"class":186},[172,413,414],{"class":174,"line":215},[172,415,212],{"class":186},[172,417,418,420,422,425,428],{"class":174,"line":226},[172,419,179],{"class":178},[172,421,183],{"class":182},[172,423,424],{"class":186}," : D1, ",[172,426,427],{"class":182},"D2",[172,429,375],{"class":186},[172,431,432],{"class":174,"line":239},[172,433,212],{"class":186},[172,435,436,438,440,443,446,448,451,455],{"class":174,"line":250},[172,437,95],{"class":178},[172,439,220],{"class":196},[172,441,442],{"class":186},"(",[172,444,445],{"class":232},"const",[172,447,372],{"class":182},[172,449,450],{"class":232}," *",[172,452,454],{"class":453},"sTHNf","b",[172,456,457],{"class":186},") {}\n",[172,459,460],{"class":174,"line":341},[172,461,212],{"class":186},[172,463,465,467,470],{"class":174,"line":464},10,[172,466,95],{"class":178},[172,468,469],{"class":196}," g",[172,471,223],{"class":186},[172,473,475,477,479,481,483,485],{"class":174,"line":474},11,[172,476,229],{"class":186},[172,478,233],{"class":232},[172,480,313],{"class":186},[172,482,316],{"class":232},[172,484,319],{"class":232},[172,486,322],{"class":186},[172,488,490],{"class":174,"line":489},12,[172,491,493],{"class":492},"s8-w5","  \u002F\u002F Use s\n",[172,495,497,499],{"class":174,"line":496},13,[172,498,335],{"class":232},[172,500,338],{"class":186},[172,502,504],{"class":174,"line":503},14,[172,505,212],{"class":186},[172,507,509,512],{"class":174,"line":508},15,[172,510,511],{"class":196},"  f",[172,513,514],{"class":186},"(s);\n",[172,516,518],{"class":174,"line":517},16,[172,519,253],{"class":186},[39,521,522,523,526,527,529],{},"Despite the fact that ",[63,524,525],{},"f()"," never makes use of the object, its being passed as an argument to ",[63,528,525],{}," is sufficient to trigger undefined behavior.",[149,531,257],{"id":532},"compliant-solution-1",[39,534,535,536,539,540],{},"In this compliant solution, the lifetime of ",[63,537,538],{},"s"," is extended to cover the call to ",[63,541,542],{},"f().",[159,544,545],{"quality":266},[163,546,548],{"className":165,"code":547,"language":167,"meta":168,"style":168},"struct B {};\n \nstruct D1 : virtual B {};\nstruct D2 : virtual B {};\n \nstruct S : D1, D2 {};\n \nvoid f(const B *b) {}\n \nvoid g() {\n  S *s = new S;\n  \u002F\u002F Use s\n  f(s);\n \n  delete s;\n}\n",[63,549,550,558,562,576,590,594,606,610,628,632,640,654,658,664,668,674],{"__ignoreMap":168},[172,551,552,554,556],{"class":174,"line":175},[172,553,179],{"class":178},[172,555,372],{"class":182},[172,557,375],{"class":186},[172,559,560],{"class":174,"line":190},[172,561,296],{"class":186},[172,563,564,566,568,570,572,574],{"class":174,"line":203},[172,565,179],{"class":178},[172,567,386],{"class":182},[172,569,389],{"class":186},[172,571,392],{"class":178},[172,573,372],{"class":182},[172,575,375],{"class":186},[172,577,578,580,582,584,586,588],{"class":174,"line":209},[172,579,179],{"class":178},[172,581,403],{"class":182},[172,583,389],{"class":186},[172,585,392],{"class":178},[172,587,372],{"class":182},[172,589,375],{"class":186},[172,591,592],{"class":174,"line":215},[172,593,296],{"class":186},[172,595,596,598,600,602,604],{"class":174,"line":226},[172,597,179],{"class":178},[172,599,183],{"class":182},[172,601,424],{"class":186},[172,603,427],{"class":182},[172,605,375],{"class":186},[172,607,608],{"class":174,"line":239},[172,609,296],{"class":186},[172,611,612,614,616,618,620,622,624,626],{"class":174,"line":250},[172,613,95],{"class":178},[172,615,220],{"class":196},[172,617,442],{"class":186},[172,619,445],{"class":232},[172,621,372],{"class":182},[172,623,450],{"class":232},[172,625,454],{"class":453},[172,627,457],{"class":186},[172,629,630],{"class":174,"line":341},[172,631,296],{"class":186},[172,633,634,636,638],{"class":174,"line":464},[172,635,95],{"class":178},[172,637,469],{"class":196},[172,639,223],{"class":186},[172,641,642,644,646,648,650,652],{"class":174,"line":474},[172,643,229],{"class":186},[172,645,233],{"class":232},[172,647,313],{"class":186},[172,649,316],{"class":232},[172,651,319],{"class":232},[172,653,322],{"class":186},[172,655,656],{"class":174,"line":489},[172,657,493],{"class":492},[172,659,660,662],{"class":174,"line":496},[172,661,511],{"class":196},[172,663,514],{"class":186},[172,665,666],{"class":174,"line":503},[172,667,212],{"class":186},[172,669,670,672],{"class":174,"line":508},[172,671,335],{"class":232},[172,673,338],{"class":186},[172,675,676],{"class":174,"line":517},[172,677,253],{"class":186},[149,679,152],{"id":680},"noncompliant-code-example-2",[39,682,683,684,686,687,690,691,694,695,47],{},"In this noncompliant code example, the address of a local variable is returned from ",[63,685,525],{}," . When the resulting pointer is passed to ",[63,688,689],{},"h()"," , the lvalue-to-rvalue conversion applied to ",[63,692,693],{},"i"," results in ",[43,696,46],{"href":45},[159,698,699],{"quality":161},[163,700,702],{"className":165,"code":701,"language":167,"meta":168,"style":168},"int *g() {\n  int i = 12;\n  return &i;\n}\n \nvoid h(int *i);\n \nvoid f() {\n  int *i = g();\n  h(i);\n}\n",[63,703,704,716,733,744,748,752,770,774,782,797,805],{"__ignoreMap":168},[172,705,706,709,711,714],{"class":174,"line":175},[172,707,708],{"class":178},"int",[172,710,450],{"class":232},[172,712,713],{"class":196},"g",[172,715,223],{"class":186},[172,717,718,721,724,726,730],{"class":174,"line":190},[172,719,720],{"class":178},"  int",[172,722,723],{"class":186}," i ",[172,725,316],{"class":232},[172,727,729],{"class":728},"s7F3e"," 12",[172,731,732],{"class":186},";\n",[172,734,735,738,741],{"class":174,"line":203},[172,736,737],{"class":232},"  return",[172,739,740],{"class":232}," &",[172,742,743],{"class":186},"i;\n",[172,745,746],{"class":174,"line":209},[172,747,253],{"class":186},[172,749,750],{"class":174,"line":215},[172,751,212],{"class":186},[172,753,754,756,759,761,763,765,767],{"class":174,"line":226},[172,755,95],{"class":178},[172,757,758],{"class":196}," h",[172,760,442],{"class":186},[172,762,708],{"class":178},[172,764,450],{"class":232},[172,766,693],{"class":453},[172,768,769],{"class":186},");\n",[172,771,772],{"class":174,"line":239},[172,773,212],{"class":186},[172,775,776,778,780],{"class":174,"line":250},[172,777,95],{"class":178},[172,779,220],{"class":196},[172,781,223],{"class":186},[172,783,784,786,788,791,793,795],{"class":174,"line":341},[172,785,720],{"class":178},[172,787,450],{"class":232},[172,789,790],{"class":186},"i ",[172,792,316],{"class":232},[172,794,469],{"class":196},[172,796,200],{"class":186},[172,798,799,802],{"class":174,"line":464},[172,800,801],{"class":196},"  h",[172,803,804],{"class":186},"(i);\n",[172,806,807],{"class":174,"line":474},[172,808,253],{"class":186},[39,810,811],{},"Some compilers generate a diagnostic message when a pointer to an object with automatic storage duration is returned from a function, as in this example.",[149,813,257],{"id":814},"compliant-solution-2",[39,816,817,818,821,822],{},"In this compliant solution, the local variable returned from ",[63,819,820],{},"g()"," has static storage duration instead of automatic storage duration, extending its lifetime sufficiently for use within ",[63,823,542],{},[159,825,826],{"quality":266},[163,827,829],{"className":165,"code":828,"language":167,"meta":168,"style":168},"int *g() {\n  static int i = 12;\n  return &i;\n}\n \nvoid h(int *i);\n \nvoid f() {\n  int *i = g();\n  h(i);\n}\n",[63,830,831,841,857,865,869,873,889,893,901,915,921],{"__ignoreMap":168},[172,832,833,835,837,839],{"class":174,"line":175},[172,834,708],{"class":178},[172,836,450],{"class":232},[172,838,713],{"class":196},[172,840,223],{"class":186},[172,842,843,846,849,851,853,855],{"class":174,"line":190},[172,844,845],{"class":232},"  static",[172,847,848],{"class":178}," int",[172,850,723],{"class":186},[172,852,316],{"class":232},[172,854,729],{"class":728},[172,856,732],{"class":186},[172,858,859,861,863],{"class":174,"line":203},[172,860,737],{"class":232},[172,862,740],{"class":232},[172,864,743],{"class":186},[172,866,867],{"class":174,"line":209},[172,868,253],{"class":186},[172,870,871],{"class":174,"line":215},[172,872,296],{"class":186},[172,874,875,877,879,881,883,885,887],{"class":174,"line":226},[172,876,95],{"class":178},[172,878,758],{"class":196},[172,880,442],{"class":186},[172,882,708],{"class":178},[172,884,450],{"class":232},[172,886,693],{"class":453},[172,888,769],{"class":186},[172,890,891],{"class":174,"line":239},[172,892,296],{"class":186},[172,894,895,897,899],{"class":174,"line":250},[172,896,95],{"class":178},[172,898,220],{"class":196},[172,900,223],{"class":186},[172,902,903,905,907,909,911,913],{"class":174,"line":341},[172,904,720],{"class":178},[172,906,450],{"class":232},[172,908,790],{"class":186},[172,910,316],{"class":232},[172,912,469],{"class":196},[172,914,200],{"class":186},[172,916,917,919],{"class":174,"line":464},[172,918,801],{"class":196},[172,920,804],{"class":186},[172,922,923],{"class":174,"line":474},[172,924,253],{"class":186},[149,926,152],{"id":927},"noncompliant-code-example-3",[39,929,930,931,934,935,937,938,940,941,943],{},"A ",[63,932,933],{},"std::initializer_list\u003C>"," object is constructed from an initializer list as though the implementation allocated a temporary array and passed it to the ",[63,936,933],{}," constructor. This temporary array has the same lifetime as other temporary objects except that initializing a ",[63,939,933],{}," object from the array extends the lifetime of the array exactly like binding a reference to a temporary [ ",[43,942,54],{"href":53}," ].",[39,945,946,947,950,951,954,955,957,958,47],{},"In this noncompliant code example, a member variable of type ",[63,948,949],{},"std::initializer_list\u003Cint>"," is list-initialized within the constructor's ",[72,952,953],{},"ctor-initializer"," . Under these circumstances, the conceptual temporary array's lifetime ends once the constructor exits, so accessing any elements of the ",[63,956,949],{}," member variable results in ",[43,959,46],{"href":45},[159,961,962],{"quality":161},[163,963,965],{"className":165,"code":964,"language":167,"meta":168,"style":168},"#include \u003Cinitializer_list>\n#include \u003Ciostream>\n\nclass C {\n  std::initializer_list\u003Cint> l;\n  \npublic:\n  C() : l{1, 2, 3} {}\n  \n  int first() const { return *l.begin(); }\n};\n\nvoid f() {\n  C c;\n  std::cout \u003C\u003C c.first();\n}\n",[63,966,967,976,983,988,998,1017,1022,1027,1058,1062,1091,1095,1099,1107,1112,1130],{"__ignoreMap":168},[172,968,969,972],{"class":174,"line":175},[172,970,971],{"class":232},"#include",[172,973,975],{"class":974},"sstjo"," \u003Cinitializer_list>\n",[172,977,978,980],{"class":174,"line":190},[172,979,971],{"class":232},[172,981,982],{"class":974}," \u003Ciostream>\n",[172,984,985],{"class":174,"line":203},[172,986,987],{"emptyLinePlaceholder":7},"\n",[172,989,990,993,996],{"class":174,"line":209},[172,991,992],{"class":178},"class",[172,994,995],{"class":182}," C",[172,997,187],{"class":186},[172,999,1000,1003,1006,1009,1011,1014],{"class":174,"line":215},[172,1001,1002],{"class":182},"  std",[172,1004,1005],{"class":186},"::initializer_list",[172,1007,1008],{"class":232},"\u003C",[172,1010,708],{"class":178},[172,1012,1013],{"class":232},">",[172,1015,1016],{"class":186}," l;\n",[172,1018,1019],{"class":174,"line":226},[172,1020,1021],{"class":186},"  \n",[172,1023,1024],{"class":174,"line":239},[172,1025,1026],{"class":178},"public:\n",[172,1028,1029,1032,1035,1038,1041,1044,1047,1050,1052,1055],{"class":174,"line":250},[172,1030,1031],{"class":196},"  C",[172,1033,1034],{"class":186},"() : ",[172,1036,1037],{"class":196},"l",[172,1039,1040],{"class":186},"{",[172,1042,1043],{"class":728},"1",[172,1045,1046],{"class":186},", ",[172,1048,1049],{"class":728},"2",[172,1051,1046],{"class":186},[172,1053,1054],{"class":728},"3",[172,1056,1057],{"class":186},"} {}\n",[172,1059,1060],{"class":174,"line":341},[172,1061,1021],{"class":186},[172,1063,1064,1066,1069,1072,1074,1077,1080,1082,1085,1088],{"class":174,"line":464},[172,1065,720],{"class":178},[172,1067,1068],{"class":196}," first",[172,1070,1071],{"class":186},"() ",[172,1073,445],{"class":232},[172,1075,1076],{"class":186}," { ",[172,1078,1079],{"class":232},"return",[172,1081,450],{"class":232},[172,1083,1084],{"class":186},"l.",[172,1086,1087],{"class":196},"begin",[172,1089,1090],{"class":186},"(); }\n",[172,1092,1093],{"class":174,"line":474},[172,1094,206],{"class":186},[172,1096,1097],{"class":174,"line":489},[172,1098,987],{"emptyLinePlaceholder":7},[172,1100,1101,1103,1105],{"class":174,"line":496},[172,1102,95],{"class":178},[172,1104,220],{"class":196},[172,1106,223],{"class":186},[172,1108,1109],{"class":174,"line":503},[172,1110,1111],{"class":186},"  C c;\n",[172,1113,1114,1116,1119,1122,1125,1128],{"class":174,"line":508},[172,1115,1002],{"class":182},[172,1117,1118],{"class":186},"::cout ",[172,1120,1121],{"class":232},"\u003C\u003C",[172,1123,1124],{"class":186}," c.",[172,1126,1127],{"class":196},"first",[172,1129,200],{"class":186},[172,1131,1132],{"class":174,"line":517},[172,1133,253],{"class":186},[149,1135,257],{"id":1136},"compliant-solution-3",[39,1138,1139,1140,1142,1143,1146],{},"In this compliant solution, the ",[63,1141,949],{}," member variable is replaced with a ",[63,1144,1145],{},"std::vector\u003Cint>"," , which copies the elements of the initializer list to the container instead of relying on a dangling reference to the temporary array.",[159,1148,1149],{"quality":266},[163,1150,1152],{"className":165,"code":1151,"language":167,"meta":168,"style":168},"#include \u003Ciostream>\n#include \u003Cvector>\n \nclass C {\n  std::vector\u003Cint> l;\n  \npublic:\n  C() : l{1, 2, 3} {}\n  \n  int first() const { return *l.begin(); }\n};\n \nvoid f() {\n  C c;\n  std::cout \u003C\u003C c.first();\n}\n",[63,1153,1154,1160,1167,1171,1179,1194,1198,1202,1224,1228,1250,1254,1258,1266,1270,1284],{"__ignoreMap":168},[172,1155,1156,1158],{"class":174,"line":175},[172,1157,971],{"class":232},[172,1159,982],{"class":974},[172,1161,1162,1164],{"class":174,"line":190},[172,1163,971],{"class":232},[172,1165,1166],{"class":974}," \u003Cvector>\n",[172,1168,1169],{"class":174,"line":203},[172,1170,296],{"class":186},[172,1172,1173,1175,1177],{"class":174,"line":209},[172,1174,992],{"class":178},[172,1176,995],{"class":182},[172,1178,187],{"class":186},[172,1180,1181,1183,1186,1188,1190,1192],{"class":174,"line":215},[172,1182,1002],{"class":182},[172,1184,1185],{"class":186},"::vector",[172,1187,1008],{"class":232},[172,1189,708],{"class":178},[172,1191,1013],{"class":232},[172,1193,1016],{"class":186},[172,1195,1196],{"class":174,"line":226},[172,1197,1021],{"class":186},[172,1199,1200],{"class":174,"line":239},[172,1201,1026],{"class":178},[172,1203,1204,1206,1208,1210,1212,1214,1216,1218,1220,1222],{"class":174,"line":250},[172,1205,1031],{"class":196},[172,1207,1034],{"class":186},[172,1209,1037],{"class":196},[172,1211,1040],{"class":186},[172,1213,1043],{"class":728},[172,1215,1046],{"class":186},[172,1217,1049],{"class":728},[172,1219,1046],{"class":186},[172,1221,1054],{"class":728},[172,1223,1057],{"class":186},[172,1225,1226],{"class":174,"line":341},[172,1227,1021],{"class":186},[172,1229,1230,1232,1234,1236,1238,1240,1242,1244,1246,1248],{"class":174,"line":464},[172,1231,720],{"class":178},[172,1233,1068],{"class":196},[172,1235,1071],{"class":186},[172,1237,445],{"class":232},[172,1239,1076],{"class":186},[172,1241,1079],{"class":232},[172,1243,450],{"class":232},[172,1245,1084],{"class":186},[172,1247,1087],{"class":196},[172,1249,1090],{"class":186},[172,1251,1252],{"class":174,"line":474},[172,1253,206],{"class":186},[172,1255,1256],{"class":174,"line":489},[172,1257,296],{"class":186},[172,1259,1260,1262,1264],{"class":174,"line":496},[172,1261,95],{"class":178},[172,1263,220],{"class":196},[172,1265,223],{"class":186},[172,1267,1268],{"class":174,"line":503},[172,1269,1111],{"class":186},[172,1271,1272,1274,1276,1278,1280,1282],{"class":174,"line":508},[172,1273,1002],{"class":182},[172,1275,1118],{"class":186},[172,1277,1121],{"class":232},[172,1279,1124],{"class":186},[172,1281,1127],{"class":196},[172,1283,200],{"class":186},[172,1285,1286],{"class":174,"line":517},[172,1287,253],{"class":186},[149,1289,152],{"id":1290},"noncompliant-code-example-4",[39,1292,1293,1294,1296,1297,1299,1300,1303],{},"In this noncompliant code example, a lambda object is stored in a function object, which is later called (executing the lambda) to obtain a constant reference to a value. The lambda object returns an ",[63,1295,708],{}," value, which is then stored in a temporary ",[63,1298,708],{}," object that becomes bound to the ",[63,1301,1302],{},"  const int & "," return type specified by the function object. However, the temporary object's lifetime is not extended past the return from the function object's invocation, which causes undefined behavior when the resulting value is accessed.",[159,1305,1306],{"quality":161},[163,1307,1309],{"className":165,"code":1308,"language":167,"meta":168,"style":168},"#include \u003Cfunctional>\n \nvoid f() {\n  auto l = [](const int &j) { return j; };\n  std::function\u003Cconst int&(const int &)> fn(l);\n \n  int i = 42;\n  int j = fn(i);\n}\n",[63,1310,1311,1318,1322,1330,1360,1394,1398,1411,1424],{"__ignoreMap":168},[172,1312,1313,1315],{"class":174,"line":175},[172,1314,971],{"class":232},[172,1316,1317],{"class":974}," \u003Cfunctional>\n",[172,1319,1320],{"class":174,"line":190},[172,1321,212],{"class":186},[172,1323,1324,1326,1328],{"class":174,"line":203},[172,1325,95],{"class":178},[172,1327,220],{"class":196},[172,1329,223],{"class":186},[172,1331,1332,1335,1338,1340,1343,1345,1347,1349,1352,1355,1357],{"class":174,"line":209},[172,1333,1334],{"class":178},"  auto",[172,1336,1337],{"class":186}," l ",[172,1339,316],{"class":232},[172,1341,1342],{"class":186}," [](",[172,1344,445],{"class":232},[172,1346,848],{"class":178},[172,1348,740],{"class":232},[172,1350,1351],{"class":453},"j",[172,1353,1354],{"class":186},") { ",[172,1356,1079],{"class":232},[172,1358,1359],{"class":186}," j; };\n",[172,1361,1362,1364,1367,1370,1372,1375,1377,1379,1381,1383,1386,1388,1391],{"class":174,"line":215},[172,1363,1002],{"class":182},[172,1365,1366],{"class":186},"::function",[172,1368,1369],{"class":232},"\u003Cconst",[172,1371,848],{"class":178},[172,1373,1374],{"class":232},"&",[172,1376,442],{"class":186},[172,1378,445],{"class":232},[172,1380,848],{"class":178},[172,1382,740],{"class":232},[172,1384,1385],{"class":186},")",[172,1387,1013],{"class":232},[172,1389,1390],{"class":196}," fn",[172,1392,1393],{"class":186},"(l);\n",[172,1395,1396],{"class":174,"line":226},[172,1397,212],{"class":186},[172,1399,1400,1402,1404,1406,1409],{"class":174,"line":239},[172,1401,720],{"class":178},[172,1403,723],{"class":186},[172,1405,316],{"class":232},[172,1407,1408],{"class":728}," 42",[172,1410,732],{"class":186},[172,1412,1413,1415,1418,1420,1422],{"class":174,"line":250},[172,1414,720],{"class":178},[172,1416,1417],{"class":186}," j ",[172,1419,316],{"class":232},[172,1421,1390],{"class":196},[172,1423,804],{"class":186},[172,1425,1426],{"class":174,"line":341},[172,1427,253],{"class":186},[149,1429,257],{"id":1430},"compliant-solution-4",[39,1432,1139,1433,1436,1437,1439,1440,1442,1443,1446],{},[63,1434,1435],{},"std::function"," object returns an ",[63,1438,708],{}," instead of a ",[63,1441,1302],{}," , ensuring that the value is copied instead of bound to a temporary reference. An alternative solution would be to call the lambda directly instead of through the ",[63,1444,1445],{},"std::function\u003C>"," object.",[159,1448,1449],{"quality":266},[163,1450,1452],{"className":165,"code":1451,"language":167,"meta":168,"style":168},"#include \u003Cfunctional>\n \nvoid f() {\n  auto l = [](const int &j) { return j; };\n  std::function\u003Cint(const int &)> fn(l);\n \n  int i = 42;\n  int j = fn(i);\n}\n",[63,1453,1454,1460,1464,1472,1496,1522,1526,1538,1550],{"__ignoreMap":168},[172,1455,1456,1458],{"class":174,"line":175},[172,1457,971],{"class":232},[172,1459,1317],{"class":974},[172,1461,1462],{"class":174,"line":190},[172,1463,296],{"class":186},[172,1465,1466,1468,1470],{"class":174,"line":203},[172,1467,95],{"class":178},[172,1469,220],{"class":196},[172,1471,223],{"class":186},[172,1473,1474,1476,1478,1480,1482,1484,1486,1488,1490,1492,1494],{"class":174,"line":209},[172,1475,1334],{"class":178},[172,1477,1337],{"class":186},[172,1479,316],{"class":232},[172,1481,1342],{"class":186},[172,1483,445],{"class":232},[172,1485,848],{"class":178},[172,1487,740],{"class":232},[172,1489,1351],{"class":453},[172,1491,1354],{"class":186},[172,1493,1079],{"class":232},[172,1495,1359],{"class":186},[172,1497,1498,1500,1502,1504,1506,1508,1510,1512,1514,1516,1518,1520],{"class":174,"line":215},[172,1499,1002],{"class":182},[172,1501,1366],{"class":186},[172,1503,1008],{"class":232},[172,1505,708],{"class":178},[172,1507,442],{"class":186},[172,1509,445],{"class":232},[172,1511,848],{"class":178},[172,1513,740],{"class":232},[172,1515,1385],{"class":186},[172,1517,1013],{"class":232},[172,1519,1390],{"class":196},[172,1521,1393],{"class":186},[172,1523,1524],{"class":174,"line":226},[172,1525,296],{"class":186},[172,1527,1528,1530,1532,1534,1536],{"class":174,"line":239},[172,1529,720],{"class":178},[172,1531,723],{"class":186},[172,1533,316],{"class":232},[172,1535,1408],{"class":728},[172,1537,732],{"class":186},[172,1539,1540,1542,1544,1546,1548],{"class":174,"line":250},[172,1541,720],{"class":178},[172,1543,1417],{"class":186},[172,1545,316],{"class":232},[172,1547,1390],{"class":196},[172,1549,804],{"class":186},[172,1551,1552],{"class":174,"line":341},[172,1553,253],{"class":186},[149,1555,152],{"id":1556},"noncompliant-code-example-5",[39,1558,1559,1560,1562,1563,1566,1567,1569,1570,1573],{},"In this noncompliant code example, the constructor for the automatic variable ",[63,1561,538],{}," is not called because execution does not flow through the declaration of the local variable due to the ",[63,1564,1565],{},"goto"," statement. Because the constructor is not called, the lifetime for ",[63,1568,538],{}," has not begun. Therefore, calling ",[63,1571,1572],{},"S::f()"," uses the object outside of its lifetime and results in undefined behavior.",[159,1575,1576],{"quality":161},[163,1577,1579],{"className":165,"code":1578,"language":167,"meta":168,"style":168},"class S { \n  int v; \n \npublic: \n  S() : v(12) {} \u002F\u002F Non-trivial constructor \n \n  void f(); \n};   \n \nvoid f() { \n \n  \u002F\u002F ...   \n \n  goto bad_idea;   \n \n  \u002F\u002F ... \n \n  S s; \u002F\u002F Control passes over the declaration, so initialization does not take place.   \n \n  bad_idea: \n    s.f(); \n}\n",[63,1580,1581,1590,1597,1601,1608,1629,1633,1642,1647,1651,1660,1664,1669,1673,1685,1689,1694,1699,1708,1713,1722,1733],{"__ignoreMap":168},[172,1582,1583,1585,1587],{"class":174,"line":175},[172,1584,992],{"class":178},[172,1586,183],{"class":182},[172,1588,1589],{"class":186}," { \n",[172,1591,1592,1594],{"class":174,"line":190},[172,1593,720],{"class":178},[172,1595,1596],{"class":186}," v; \n",[172,1598,1599],{"class":174,"line":203},[172,1600,212],{"class":186},[172,1602,1603,1606],{"class":174,"line":209},[172,1604,1605],{"class":178},"public:",[172,1607,296],{"class":186},[172,1609,1610,1613,1615,1618,1620,1623,1626],{"class":174,"line":215},[172,1611,1612],{"class":196},"  S",[172,1614,1034],{"class":186},[172,1616,1617],{"class":196},"v",[172,1619,442],{"class":186},[172,1621,1622],{"class":728},"12",[172,1624,1625],{"class":186},") {}",[172,1627,1628],{"class":492}," \u002F\u002F Non-trivial constructor \n",[172,1630,1631],{"class":174,"line":226},[172,1632,212],{"class":186},[172,1634,1635,1637,1639],{"class":174,"line":239},[172,1636,193],{"class":178},[172,1638,220],{"class":196},[172,1640,1641],{"class":186},"(); \n",[172,1643,1644],{"class":174,"line":250},[172,1645,1646],{"class":186},"};   \n",[172,1648,1649],{"class":174,"line":341},[172,1650,212],{"class":186},[172,1652,1653,1655,1657],{"class":174,"line":464},[172,1654,95],{"class":178},[172,1656,220],{"class":196},[172,1658,1659],{"class":186},"() { \n",[172,1661,1662],{"class":174,"line":474},[172,1663,212],{"class":186},[172,1665,1666],{"class":174,"line":489},[172,1667,1668],{"class":492},"  \u002F\u002F ...   \n",[172,1670,1671],{"class":174,"line":496},[172,1672,212],{"class":186},[172,1674,1675,1678,1682],{"class":174,"line":503},[172,1676,1677],{"class":232},"  goto",[172,1679,1681],{"class":1680},"s_OQ2"," bad_idea",[172,1683,1684],{"class":186},";   \n",[172,1686,1687],{"class":174,"line":508},[172,1688,212],{"class":186},[172,1690,1691],{"class":174,"line":517},[172,1692,1693],{"class":492},"  \u002F\u002F ... \n",[172,1695,1697],{"class":174,"line":1696},17,[172,1698,212],{"class":186},[172,1700,1702,1705],{"class":174,"line":1701},18,[172,1703,1704],{"class":186},"  S s;",[172,1706,1707],{"class":492}," \u002F\u002F Control passes over the declaration, so initialization does not take place.   \n",[172,1709,1711],{"class":174,"line":1710},19,[172,1712,212],{"class":186},[172,1714,1716,1719],{"class":174,"line":1715},20,[172,1717,1718],{"class":1680},"  bad_idea",[172,1720,1721],{"class":186},": \n",[172,1723,1725,1728,1731],{"class":174,"line":1724},21,[172,1726,1727],{"class":186},"    s.",[172,1729,1730],{"class":196},"f",[172,1732,1641],{"class":186},[172,1734,1736],{"class":174,"line":1735},22,[172,1737,253],{"class":186},[149,1739,257],{"id":1740},"compliant-solution-5",[39,1742,1743,1744,1746],{},"This compliant solution ensures that ",[63,1745,538],{}," is properly initialized prior to performing the local jump.",[159,1748,1749],{"quality":266},[163,1750,1752],{"className":165,"code":1751,"language":167,"meta":168,"style":168},"class S { \n  int v; \n \npublic: \n  S() : v(12) {} \u002F\u002F Non-trivial constructor \n  \n  void f(); \n};   \n \nvoid f() { \n  S s; \n \n  \u002F\u002F ... \n \n  goto bad_idea; \n \n  \u002F\u002F ... \n \n  bad_idea: \n    s.f(); \n}\n",[63,1753,1754,1762,1768,1772,1778,1794,1798,1806,1810,1814,1822,1827,1831,1835,1839,1848,1852,1856,1860,1866,1874],{"__ignoreMap":168},[172,1755,1756,1758,1760],{"class":174,"line":175},[172,1757,992],{"class":178},[172,1759,183],{"class":182},[172,1761,1589],{"class":186},[172,1763,1764,1766],{"class":174,"line":190},[172,1765,720],{"class":178},[172,1767,1596],{"class":186},[172,1769,1770],{"class":174,"line":203},[172,1771,212],{"class":186},[172,1773,1774,1776],{"class":174,"line":209},[172,1775,1605],{"class":178},[172,1777,296],{"class":186},[172,1779,1780,1782,1784,1786,1788,1790,1792],{"class":174,"line":215},[172,1781,1612],{"class":196},[172,1783,1034],{"class":186},[172,1785,1617],{"class":196},[172,1787,442],{"class":186},[172,1789,1622],{"class":728},[172,1791,1625],{"class":186},[172,1793,1628],{"class":492},[172,1795,1796],{"class":174,"line":226},[172,1797,1021],{"class":186},[172,1799,1800,1802,1804],{"class":174,"line":239},[172,1801,193],{"class":178},[172,1803,220],{"class":196},[172,1805,1641],{"class":186},[172,1807,1808],{"class":174,"line":250},[172,1809,1646],{"class":186},[172,1811,1812],{"class":174,"line":341},[172,1813,212],{"class":186},[172,1815,1816,1818,1820],{"class":174,"line":464},[172,1817,95],{"class":178},[172,1819,220],{"class":196},[172,1821,1659],{"class":186},[172,1823,1824],{"class":174,"line":474},[172,1825,1826],{"class":186},"  S s; \n",[172,1828,1829],{"class":174,"line":489},[172,1830,212],{"class":186},[172,1832,1833],{"class":174,"line":496},[172,1834,1693],{"class":492},[172,1836,1837],{"class":174,"line":503},[172,1838,212],{"class":186},[172,1840,1841,1843,1845],{"class":174,"line":508},[172,1842,1677],{"class":232},[172,1844,1681],{"class":1680},[172,1846,1847],{"class":186},"; \n",[172,1849,1850],{"class":174,"line":517},[172,1851,212],{"class":186},[172,1853,1854],{"class":174,"line":1696},[172,1855,1693],{"class":492},[172,1857,1858],{"class":174,"line":1701},[172,1859,212],{"class":186},[172,1861,1862,1864],{"class":174,"line":1710},[172,1863,1718],{"class":1680},[172,1865,1721],{"class":186},[172,1867,1868,1870,1872],{"class":174,"line":1715},[172,1869,1727],{"class":186},[172,1871,1730],{"class":196},[172,1873,1641],{"class":186},[172,1875,1876],{"class":174,"line":1724},[172,1877,253],{"class":186},[149,1879,152],{"id":1880},"noncompliant-code-example-6",[39,1882,1883,1884,1886,1887,1890,1891,1894,1895,1898,1899,1901,1902,1904],{},"In this noncompliant code example, ",[63,1885,525],{}," is called with an iterable range of objects of type ",[63,1888,1889],{},"S"," . These objects are copied into a temporary buffer using ",[63,1892,1893],{},"std::copy()"," , and when processing of those objects is complete, the temporary buffer is deallocated. However, the buffer returned by ",[63,1896,1897],{},"std::get_temporary_buffer()"," does not contain initialized objects of type ",[63,1900,1889],{}," , so when ",[63,1903,1893],{}," dereferences the destination iterator, it results in undefined behavior because the object referenced by the destination iterator has yet to start its lifetime. This is because while space for the object has been allocated, no constructors or initializers have been invoked.",[159,1906,1907],{"quality":161},[163,1908,1910],{"className":165,"code":1909,"language":167,"meta":168,"style":168},"#include \u003Calgorithm>\n#include \u003Ccstddef>\n#include \u003Cmemory>\n#include \u003Ctype_traits>\n \nclass S {\n  int i;\n\npublic:\n  S() : i(0) {}\n  S(int i) : i(i) {}\n  S(const S&) = default;\n  S& operator=(const S&) = default;\n};\n\ntemplate \u003Ctypename Iter>\nvoid f(Iter i, Iter e) {\n  static_assert(std::is_same\u003Ctypename std::iterator_traits\u003CIter>::value_type, S>::value,\n                \"Expecting iterators over type S\");\n  ptrdiff_t count = std::distance(i, e);\n  if (!count) {\n    return;\n  }\n  \n  \u002F\u002F Get some temporary memory.\n  auto p = std::get_temporary_buffer\u003CS>(count);\n  if (p.second \u003C count) {\n    \u002F\u002F Handle error; memory wasn't allocated, or insufficient memory was allocated.\n    return;\n  }\n  S *vals = p.first; \n  \n  \u002F\u002F Copy the values into the memory.\n  std::copy(i, e, vals);\n  \n  \u002F\u002F ...\n  \n  \u002F\u002F Return the temporary memory.\n  std::return_temporary_buffer(vals);\n}\n",[63,1911,1912,1919,1926,1933,1940,1944,1952,1959,1963,1967,1982,2001,2023,2050,2054,2058,2075,2098,2143,2150,2171,2185,2192,2198,2203,2209,2233,2246,2252,2259,2264,2279,2284,2290,2303,2308,2314,2319,2325,2338],{"__ignoreMap":168},[172,1913,1914,1916],{"class":174,"line":175},[172,1915,971],{"class":232},[172,1917,1918],{"class":974}," \u003Calgorithm>\n",[172,1920,1921,1923],{"class":174,"line":190},[172,1922,971],{"class":232},[172,1924,1925],{"class":974}," \u003Ccstddef>\n",[172,1927,1928,1930],{"class":174,"line":203},[172,1929,971],{"class":232},[172,1931,1932],{"class":974}," \u003Cmemory>\n",[172,1934,1935,1937],{"class":174,"line":209},[172,1936,971],{"class":232},[172,1938,1939],{"class":974}," \u003Ctype_traits>\n",[172,1941,1942],{"class":174,"line":215},[172,1943,212],{"class":186},[172,1945,1946,1948,1950],{"class":174,"line":226},[172,1947,992],{"class":178},[172,1949,183],{"class":182},[172,1951,187],{"class":186},[172,1953,1954,1956],{"class":174,"line":239},[172,1955,720],{"class":178},[172,1957,1958],{"class":186}," i;\n",[172,1960,1961],{"class":174,"line":250},[172,1962,987],{"emptyLinePlaceholder":7},[172,1964,1965],{"class":174,"line":341},[172,1966,1026],{"class":178},[172,1968,1969,1971,1973,1975,1977,1980],{"class":174,"line":464},[172,1970,1612],{"class":196},[172,1972,1034],{"class":186},[172,1974,693],{"class":196},[172,1976,442],{"class":186},[172,1978,1979],{"class":728},"0",[172,1981,457],{"class":186},[172,1983,1984,1986,1988,1990,1993,1996,1998],{"class":174,"line":474},[172,1985,1612],{"class":196},[172,1987,442],{"class":186},[172,1989,708],{"class":178},[172,1991,1992],{"class":453}," i",[172,1994,1995],{"class":186},") : ",[172,1997,693],{"class":196},[172,1999,2000],{"class":186},"(i) {}\n",[172,2002,2003,2005,2007,2009,2011,2013,2016,2018,2021],{"class":174,"line":489},[172,2004,1612],{"class":196},[172,2006,442],{"class":186},[172,2008,445],{"class":232},[172,2010,183],{"class":182},[172,2012,1374],{"class":232},[172,2014,2015],{"class":186},") ",[172,2017,316],{"class":232},[172,2019,2020],{"class":232}," default",[172,2022,732],{"class":186},[172,2024,2025,2027,2029,2032,2034,2036,2038,2040,2042,2044,2046,2048],{"class":174,"line":496},[172,2026,1612],{"class":182},[172,2028,1374],{"class":232},[172,2030,2031],{"class":232}," operator",[172,2033,316],{"class":1680},[172,2035,442],{"class":186},[172,2037,445],{"class":232},[172,2039,183],{"class":182},[172,2041,1374],{"class":232},[172,2043,2015],{"class":186},[172,2045,316],{"class":232},[172,2047,2020],{"class":232},[172,2049,732],{"class":186},[172,2051,2052],{"class":174,"line":503},[172,2053,206],{"class":186},[172,2055,2056],{"class":174,"line":508},[172,2057,987],{"emptyLinePlaceholder":7},[172,2059,2060,2063,2066,2069,2072],{"class":174,"line":517},[172,2061,2062],{"class":178},"template",[172,2064,2065],{"class":186}," \u003C",[172,2067,2068],{"class":178},"typename",[172,2070,2071],{"class":182}," Iter",[172,2073,2074],{"class":186},">\n",[172,2076,2077,2079,2081,2083,2086,2088,2090,2092,2095],{"class":174,"line":1696},[172,2078,95],{"class":178},[172,2080,220],{"class":196},[172,2082,442],{"class":186},[172,2084,2085],{"class":182},"Iter",[172,2087,1992],{"class":453},[172,2089,1046],{"class":186},[172,2091,2085],{"class":182},[172,2093,2094],{"class":453}," e",[172,2096,2097],{"class":186},") {\n",[172,2099,2100,2103,2105,2108,2111,2114,2116,2118,2121,2123,2126,2128,2130,2133,2136,2138,2140],{"class":174,"line":1701},[172,2101,2102],{"class":232},"  static_assert",[172,2104,442],{"class":186},[172,2106,2107],{"class":182},"std",[172,2109,2110],{"class":186},"::",[172,2112,2113],{"class":182},"is_same",[172,2115,1008],{"class":186},[172,2117,2068],{"class":232},[172,2119,2120],{"class":182}," std",[172,2122,2110],{"class":186},[172,2124,2125],{"class":182},"iterator_traits",[172,2127,1008],{"class":186},[172,2129,2085],{"class":182},[172,2131,2132],{"class":186},">::",[172,2134,2135],{"class":182},"value_type",[172,2137,1046],{"class":186},[172,2139,1889],{"class":182},[172,2141,2142],{"class":186},">::value,\n",[172,2144,2145,2148],{"class":174,"line":1710},[172,2146,2147],{"class":974},"                \"Expecting iterators over type S\"",[172,2149,769],{"class":186},[172,2151,2152,2156,2159,2161,2163,2165,2168],{"class":174,"line":1715},[172,2153,2155],{"class":2154},"s-m8C","  ptrdiff_t",[172,2157,2158],{"class":186}," count ",[172,2160,316],{"class":232},[172,2162,2120],{"class":182},[172,2164,2110],{"class":186},[172,2166,2167],{"class":196},"distance",[172,2169,2170],{"class":186},"(i, e);\n",[172,2172,2173,2176,2179,2182],{"class":174,"line":1724},[172,2174,2175],{"class":232},"  if",[172,2177,2178],{"class":186}," (",[172,2180,2181],{"class":232},"!",[172,2183,2184],{"class":186},"count) {\n",[172,2186,2187,2190],{"class":174,"line":1735},[172,2188,2189],{"class":232},"    return",[172,2191,732],{"class":186},[172,2193,2195],{"class":174,"line":2194},23,[172,2196,2197],{"class":186},"  }\n",[172,2199,2201],{"class":174,"line":2200},24,[172,2202,1021],{"class":186},[172,2204,2206],{"class":174,"line":2205},25,[172,2207,2208],{"class":492},"  \u002F\u002F Get some temporary memory.\n",[172,2210,2212,2214,2217,2219,2221,2223,2226,2228,2230],{"class":174,"line":2211},26,[172,2213,1334],{"class":178},[172,2215,2216],{"class":186}," p ",[172,2218,316],{"class":232},[172,2220,2120],{"class":182},[172,2222,2110],{"class":186},[172,2224,2225],{"class":196},"get_temporary_buffer",[172,2227,1008],{"class":186},[172,2229,1889],{"class":182},[172,2231,2232],{"class":186},">(count);\n",[172,2234,2236,2238,2241,2243],{"class":174,"line":2235},27,[172,2237,2175],{"class":232},[172,2239,2240],{"class":186}," (p.second ",[172,2242,1008],{"class":232},[172,2244,2245],{"class":186}," count) {\n",[172,2247,2249],{"class":174,"line":2248},28,[172,2250,2251],{"class":492},"    \u002F\u002F Handle error; memory wasn't allocated, or insufficient memory was allocated.\n",[172,2253,2255,2257],{"class":174,"line":2254},29,[172,2256,2189],{"class":232},[172,2258,732],{"class":186},[172,2260,2262],{"class":174,"line":2261},30,[172,2263,2197],{"class":186},[172,2265,2267,2269,2271,2274,2276],{"class":174,"line":2266},31,[172,2268,229],{"class":186},[172,2270,233],{"class":232},[172,2272,2273],{"class":186},"vals ",[172,2275,316],{"class":232},[172,2277,2278],{"class":186}," p.first; \n",[172,2280,2282],{"class":174,"line":2281},32,[172,2283,1021],{"class":186},[172,2285,2287],{"class":174,"line":2286},33,[172,2288,2289],{"class":492},"  \u002F\u002F Copy the values into the memory.\n",[172,2291,2293,2295,2297,2300],{"class":174,"line":2292},34,[172,2294,1002],{"class":182},[172,2296,2110],{"class":186},[172,2298,2299],{"class":196},"copy",[172,2301,2302],{"class":186},"(i, e, vals);\n",[172,2304,2306],{"class":174,"line":2305},35,[172,2307,1021],{"class":186},[172,2309,2311],{"class":174,"line":2310},36,[172,2312,2313],{"class":492},"  \u002F\u002F ...\n",[172,2315,2317],{"class":174,"line":2316},37,[172,2318,1021],{"class":186},[172,2320,2322],{"class":174,"line":2321},38,[172,2323,2324],{"class":492},"  \u002F\u002F Return the temporary memory.\n",[172,2326,2328,2330,2332,2335],{"class":174,"line":2327},39,[172,2329,1002],{"class":182},[172,2331,2110],{"class":186},[172,2333,2334],{"class":196},"return_temporary_buffer",[172,2336,2337],{"class":186},"(vals);\n",[172,2339,2341],{"class":174,"line":2340},40,[172,2342,253],{"class":186},[2344,2345,2347],"h4",{"id":2346},"implementation-details","Implementation Details",[39,2349,2350,2351,2353,2354,2356],{},"A reasonable implementation of ",[63,2352,1897],{}," and ",[63,2355,1893],{}," can result in code that behaves like the following example (with error-checking elided).",[163,2358,2362],{"className":2359,"code":2360,"language":2361,"meta":168,"style":168},"language-java shiki shiki-themes github-light github-dark monokai","unsigned char *buffer = new (std::nothrow) unsigned char[sizeof(S) * object_count];\nS *result = reinterpret_cast\u003CS *>(buffer);\nwhile (i != e) {\n  *result = *i; \u002F\u002F Undefined behavior\n  ++result;\n  ++i;\n}\n","java",[63,2363,2364,2393,2418,2432,2449,2457,2463],{"__ignoreMap":168},[172,2365,2366,2369,2371,2373,2376,2378,2380,2383,2385,2388,2390],{"class":174,"line":175},[172,2367,2368],{"class":186},"unsigned ",[172,2370,106],{"class":178},[172,2372,450],{"class":232},[172,2374,2375],{"class":186},"buffer ",[172,2377,316],{"class":232},[172,2379,319],{"class":232},[172,2381,2382],{"class":186}," (std",[172,2384,2110],{"class":232},[172,2386,2387],{"class":186},"nothrow) unsigned char[sizeof(S) ",[172,2389,233],{"class":232},[172,2391,2392],{"class":186}," object_count];\n",[172,2394,2395,2398,2400,2403,2405,2408,2410,2412,2415],{"class":174,"line":190},[172,2396,2397],{"class":186},"S ",[172,2399,233],{"class":232},[172,2401,2402],{"class":186},"result ",[172,2404,316],{"class":232},[172,2406,2407],{"class":186}," reinterpret_cast",[172,2409,1008],{"class":232},[172,2411,2397],{"class":186},[172,2413,2414],{"class":232},"*>",[172,2416,2417],{"class":186},"(buffer);\n",[172,2419,2420,2423,2426,2429],{"class":174,"line":203},[172,2421,2422],{"class":232},"while",[172,2424,2425],{"class":186}," (i ",[172,2427,2428],{"class":232},"!=",[172,2430,2431],{"class":186}," e) {\n",[172,2433,2434,2437,2439,2441,2443,2446],{"class":174,"line":209},[172,2435,2436],{"class":232},"  *",[172,2438,2402],{"class":186},[172,2440,316],{"class":232},[172,2442,450],{"class":232},[172,2444,2445],{"class":186},"i; ",[172,2447,2448],{"class":492},"\u002F\u002F Undefined behavior\n",[172,2450,2451,2454],{"class":174,"line":215},[172,2452,2453],{"class":232},"  ++",[172,2455,2456],{"class":186},"result;\n",[172,2458,2459,2461],{"class":174,"line":226},[172,2460,2453],{"class":232},[172,2462,743],{"class":186},[172,2464,2465],{"class":174,"line":239},[172,2466,253],{"class":186},[39,2468,2469,2470,2473,2474,2476],{},"The act of dereferencing ",[63,2471,2472],{},"result"," is undefined behavior because the memory pointed to is not an object of type ",[63,2475,1889],{}," within its lifetime.",[149,2478,2480,2481,2484],{"id":2479},"compliant-solution-stduninitialized_copy","Compliant Solution ( ",[63,2482,2483],{},"std::uninitialized_copy()"," )",[39,2486,2487,2488,2490,2491,2493,2494,2497],{},"In this compliant solution, ",[63,2489,2483],{}," is used to perform the copy, instead of ",[63,2492,1893],{}," , ensuring that the objects are initialized using placement ",[63,2495,2496],{},"new"," instead of dereferencing uninitialized memory. Identical code from the noncompliant code example has been elided for brevity.",[159,2499,2500],{"quality":266},[163,2501,2503],{"className":165,"code":2502,"language":167,"meta":168,"style":168},"\u002F\u002F...\n  \u002F\u002F Copy the values into the memory.\n  std::uninitialized_copy(i, e, vals);\n\u002F\u002F ...\n",[63,2504,2505,2510,2514,2525],{"__ignoreMap":168},[172,2506,2507],{"class":174,"line":175},[172,2508,2509],{"class":492},"\u002F\u002F...\n",[172,2511,2512],{"class":174,"line":190},[172,2513,2289],{"class":492},[172,2515,2516,2518,2520,2523],{"class":174,"line":203},[172,2517,1002],{"class":182},[172,2519,2110],{"class":186},[172,2521,2522],{"class":196},"uninitialized_copy",[172,2524,2302],{"class":186},[172,2526,2527],{"class":174,"line":209},[172,2528,2529],{"class":492},"\u002F\u002F ...\n",[149,2531,2480,2533,2484],{"id":2532},"compliant-solution-stdraw_storage_iterator",[63,2534,2535],{},"std::raw_storage_iterator",[39,2537,2538,2539,2541,2542,2544,2545,2547],{},"This compliant solution uses ",[63,2540,1893],{}," with a ",[63,2543,2535],{}," as the destination iterator with the same well-defined results as using ",[63,2546,2483],{}," . As with the previous compliant solution, identical code from the noncompliant code example has been elided for brevity.",[159,2549,2550],{"quality":266},[163,2551,2553],{"className":165,"code":2552,"language":167,"meta":168,"style":168},"\u002F\u002F...\n  \u002F\u002F Copy the values into the memory.\n  std::copy(i, e, std::raw_storage_iterator\u003CS*, S>(vals));\n\u002F\u002F ...\n",[63,2554,2555,2559,2563,2594],{"__ignoreMap":168},[172,2556,2557],{"class":174,"line":175},[172,2558,2509],{"class":492},[172,2560,2561],{"class":174,"line":190},[172,2562,2289],{"class":492},[172,2564,2565,2567,2569,2571,2574,2576,2578,2581,2583,2585,2587,2589,2591],{"class":174,"line":203},[172,2566,1002],{"class":182},[172,2568,2110],{"class":186},[172,2570,2299],{"class":196},[172,2572,2573],{"class":186},"(i, e, ",[172,2575,2107],{"class":182},[172,2577,2110],{"class":186},[172,2579,2580],{"class":196},"raw_storage_iterator",[172,2582,1008],{"class":186},[172,2584,1889],{"class":182},[172,2586,233],{"class":232},[172,2588,1046],{"class":186},[172,2590,1889],{"class":182},[172,2592,2593],{"class":186},">(vals));\n",[172,2595,2596],{"class":174,"line":209},[172,2597,2529],{"class":492},[149,2599,2601],{"id":2600},"risk-assessment","Risk Assessment",[39,2603,2604],{},"Referencing an object outside of its lifetime can result in an attacker being able to run arbitrary code.",[2606,2607,2608,2609,2608,2639],"table",{},"\n  ",[2610,2611,2612,2613,2608],"thead",{},"\n    ",[2614,2615,2616,2617,2616,2621,2616,2624,2616,2627,2616,2630,2616,2633,2616,2636,2612],"tr",{},"\n      ",[2618,2619,2620],"th",{},"Rule",[2618,2622,2623],{},"Severity",[2618,2625,2626],{},"Likelihood",[2618,2628,2629],{},"Detectable",[2618,2631,2632],{},"Repairable",[2618,2634,2635],{},"Priority",[2618,2637,2638],{},"Level",[2640,2641,2612,2642,2608],"tbody",{},[2614,2643,2616,2644,2616,2648,2616,2651,2616,2654,2616,2657,2616,2659,2616,2665,2612],{},[2645,2646,2647],"td",{},"EXP54-CPP",[2645,2649,2650],{},"High",[2645,2652,2653],{},"Probable",[2645,2655,2656],{},"No",[2645,2658,2656],{},[2645,2660,2662],{"style":2661},"color: #f1c40f;",[454,2663,2664],{},"P6",[2645,2666,2667],{"style":2661},[454,2668,2669],{},"L2",[149,2671,2673],{"id":2672},"automated-detection","Automated Detection",[2606,2675,2678],{"className":2676},[2677],"wrapped",[2640,2679,2680,2704,2747,2776,2807,2840,2958,2989,3031,3050,3097,3139],{},[2614,2681,2684,2689,2694,2699],{"className":2682},[2683],"header",[2618,2685,2686],{},[39,2687,2688],{},"Tool",[2618,2690,2691],{},[39,2692,2693],{},"Version",[2618,2695,2696],{},[39,2697,2698],{},"Checker",[2618,2700,2701],{},[39,2702,2703],{},"Description",[2614,2705,2708,2714,2724,2744],{"className":2706},[2707],"odd",[2645,2709,2710],{},[43,2711,2713],{"href":2712},"\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fastree","Astrée",[2645,2715,2716],{},[2717,2718,2721],"div",{"className":2719},[2720],"content-wrapper",[39,2722,2723],{},"25.10",[2645,2725,2726],{},[39,2727,2728,92,2734,92,2739],{},[2729,2730,2731,2732],"strong",{},"csa-stack-address-escape",[68,2733],{},[2729,2735,2736,2737],{},"return-reference-local",[68,2738],{},[2729,2740,2741,2742],{},"dangling_pointer_use",[68,2743],{},[2645,2745,2746],{},"Partially checked",[2614,2748,2751,2757,2763,2770],{"className":2749},[2750],"even",[2645,2752,2753],{},[43,2754,2756],{"href":2755},"\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fclang","Clang",[2645,2758,2759],{},[2717,2760,2762],{"className":2761},[2720],"3.9",[2645,2764,2765],{},[39,2766,2767],{},[2729,2768,2769],{},"-Wdangling-initializer-list",[2645,2771,2772,2773],{},"Catches some lifetime issues related to incorrect use of ",[63,2774,2775],{},"      std::initializer_list\u003C>     ",[2614,2777,2779,2785,2791,2801],{"className":2778},[2707],[2645,2780,2781],{},[43,2782,2784],{"href":2783},"\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fcodesonar","CodeSonar",[2645,2786,2787],{},[2717,2788,2790],{"className":2789},[2720],"9.1p0",[2645,2792,2793],{},[39,2794,2795],{},[2729,2796,2797,2798,2800],{},"IO.UAC",[68,2799],{},"\nALLOC.UAF",[2645,2802,2803,2804,2806],{},"Use after close",[68,2805],{},"\nUse after free",[2614,2808,2810,2816,2824,2836],{"className":2809},[2750],[2645,2811,2812],{},[43,2813,2815],{"href":2814},"\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fhelix-qac","Helix QAC",[2645,2817,2818],{},[2717,2819,2821],{"className":2820},[2720],[39,2822,2823],{},"2025.2",[2645,2825,2826,2831],{},[39,2827,2828],{},[2729,2829,2830],{},"C++4003, C++4026",[39,2832,2833],{},[2729,2834,2835],{},"DF2812, DF2813, DF2814, DF2930, DF2931, DF2932, DF2933, DF2934,",[2645,2837,2838],{},[68,2839],{},[2614,2841,2843,2849,2854,2954],{"className":2842},[2707],[2645,2844,2845],{},[43,2846,2848],{"href":2847},"\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fklocwork","Klocwork",[2645,2850,2851],{},[2717,2852,2823],{"className":2853},[2720],[2645,2855,2856,2859,2861,2864,2866,2869,2871,2874,2876,2879,2881,2884,2886,2889,2891,2894,2896,2899,2901,2904,2906,2909,2911,2914,2916,2919,2921,2924,2926,2929,2931,2934,2936,2939,2941,2944,2946,2949,2951],{},[2729,2857,2858],{},"CL.FFM.ASSIGN",[68,2860],{},[2729,2862,2863],{},"CL.FFM.COPY",[68,2865],{},[2729,2867,2868],{},"LOCRET.ARG",[68,2870],{},[2729,2872,2873],{},"LOCRET.GLOB",[68,2875],{},[2729,2877,2878],{},"LOCRET.RET",[68,2880],{},[2729,2882,2883],{},"UFM.DEREF.MIGHT",[68,2885],{},[2729,2887,2888],{},"UFM.DEREF.MUST",[68,2890],{},[2729,2892,2893],{},"UFM.FFM.MIGHT",[68,2895],{},[2729,2897,2898],{},"UFM.FFM.MUST",[68,2900],{},[2729,2902,2903],{},"UFM.RETURN.MIGHT",[68,2905],{},[2729,2907,2908],{},"UFM.RETURN.MUST",[68,2910],{},[2729,2912,2913],{},"UFM.USE.MIGHT",[68,2915],{},[2729,2917,2918],{},"UFM.USE.MUST",[68,2920],{},[2729,2922,2923],{},"UNINIT.HEAP.MIGHT",[68,2925],{},[2729,2927,2928],{},"UNINIT.HEAP.MUST",[68,2930],{},[2729,2932,2933],{},"UNINIT.STACK.ARRAY.MIGHT",[68,2935],{},[2729,2937,2938],{},"UNINIT.STACK.ARRAY.MUST",[68,2940],{},[2729,2942,2943],{},"UNINIT.STACK.ARRAY.PARTIAL.MUST",[68,2945],{},[2729,2947,2948],{},"UNINIT.STACK.MIGHT",[68,2950],{},[2729,2952,2953],{},"UNINIT.STACK.MUST",[2645,2955,2956],{},[68,2957],{},[2614,2959,2961,2967,2973,2984],{"className":2960},[2750],[2645,2962,2963],{},[43,2964,2966],{"href":2965},"\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fldra","LDRA tool suite",[2645,2968,2969],{},[2717,2970,2972],{"className":2971},[2720],"9.7.1",[2645,2974,2975],{},[39,2976,2977,92,2980],{},[2729,2978,2979],{},"42 D, 53 D, 77 D, 1 J, 71 S, 565 S",[2729,2981,2982],{},[68,2983],{},[2645,2985,2986],{},[39,2987,2988],{},"Partially implemented",[2614,2990,2992,2998,3003,3020],{"className":2991},[2707],[2645,2993,2994],{},[43,2995,2997],{"href":2996},"\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fparasoft","Parasoft C\u002FC++test",[2645,2999,3000],{},[2717,3001,2823],{"className":3002},[2720],[2645,3004,3005],{},[39,3006,3007,3010,3012,3015,3017],{},[2729,3008,3009],{},"CERT_CPP-EXP54-a",[68,3011],{},[2729,3013,3014],{},"CERT_CPP-EXP54-b",[68,3016],{},[2729,3018,3019],{},"CERT_CPP-EXP54-c",[2645,3021,3022],{},[39,3023,3024,3025,3027,3028,3030],{},"Do not use resources that have been freed",[68,3026],{},"\nThe address of an object with automatic storage shall not be returned from a function",[68,3029],{},"\nThe address of an object with automatic storage shall not be assigned to another object that may persist after the first object has ceased to exist",[2614,3032,3034,3039,3043,3047],{"className":3033},[2750],[2645,3035,3036],{},[43,3037,3038],{"href":2996},"Parasoft Insure++",[2645,3040,3041],{},[68,3042],{},[2645,3044,3045],{},[68,3046],{},[2645,3048,3049],{},"Runtime detection",[2614,3051,3053,3059,3067,3073],{"className":3052},[2707],[2645,3054,3055],{},[43,3056,3058],{"href":3057},"\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fpolyspace-bug-finder","Polyspace Bug Finder",[2645,3060,3061],{},[2717,3062,3064],{"className":3063},[2720],[39,3065,3066],{},"R2025b",[2645,3068,3069],{},[43,3070,3072],{"href":3071},"https:\u002F\u002Fwww.mathworks.com\u002Fhelp\u002Fbugfinder\u002Fref\u002Fcertcexp54cpp.html","CERT C++: EXP54-CPP",[2645,3074,3075,3078,3094],{},[39,3076,3077],{},"Checks for:",[3079,3080,3081,3085,3088,3091],"ul",{},[3082,3083,3084],"li",{},"Non-initialized variable or pointer",[3082,3086,3087],{},"Use of previously freed pointer",[3082,3089,3090],{},"Pointer or reference to stack variable leaving scope",[3082,3092,3093],{},"Accessing object with temporary lifetime",[39,3095,3096],{},"Rule partially covered.",[2614,3098,3100,3106,3114,3135],{"className":3099},[2750],[2645,3101,3102],{},[43,3103,3105],{"href":3104},"\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fpvs-studio","PVS-Studio",[2645,3107,3108],{},[2717,3109,3111],{"className":3110},[2720],[39,3112,3113],{},"7.42",[2645,3115,3116,92,3131],{},[2729,3117,3118,3122,3123,3122,3127],{},[43,3119,3121],{"href":3120},"https:\u002F\u002Fpvs-studio.com\u002Fen\u002Fdocs\u002Fwarnings\u002Fv758\u002F","V758"," , ",[43,3124,3126],{"href":3125},"https:\u002F\u002Fpvs-studio.com\u002Fen\u002Fdocs\u002Fwarnings\u002Fv1041\u002F","V1041",[43,3128,3130],{"href":3129},"https:\u002F\u002Fpvs-studio.com\u002Fen\u002Fdocs\u002Fwarnings\u002Fv1099\u002F","V1099",[2729,3132,3133],{},[68,3134],{},[2645,3136,3137],{},[68,3138],{},[2614,3140,3142,3148,3153,3163],{"className":3141},[2707],[2645,3143,3144],{},[43,3145,3147],{"href":3146},"\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Frulechecker","RuleChecker",[2645,3149,3150],{},[2717,3151,2723],{"className":3152},[2720],[2645,3154,3155],{},[39,3156,3157,92,3161],{},[2729,3158,2731,3159],{},[68,3160],{},[2729,3162,2736],{},[2645,3164,2746],{},[149,3166,3168],{"id":3167},"related-vulnerabilities","Related Vulnerabilities",[39,3170,3171,3172,3176,3177,47],{},"Search for ",[43,3173,3175],{"href":3174},"\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fbb-definitions#BB.Definitions-vulnerabil","vulnerabilities"," resulting from the violation of this rule on the ",[43,3178,3182],{"href":3179,"rel":3180},"https:\u002F\u002Fwww.kb.cert.org\u002Fvulnotes\u002Fbymetric?searchview&query=FIELD+KEYWORDS+contains+EXP34-CPP",[3181],"nofollow","CERT website",[149,3184,3186],{"id":3185},"related-guidelines","Related Guidelines",[2606,3188,3189,3197],{},[2610,3190,3191],{},[2614,3192,3193,3195],{},[2618,3194],{},[2618,3196],{},[2640,3198,3199],{},[2614,3200,3201,3206],{},[2645,3202,3203],{},[43,3204,3205],{"href":17},"SEI CERT C Coding Standard",[2645,3207,3208],{},[43,3209,3211],{"href":3210},"\u002Fsei-cert-c-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl30-c","DCL30-C. Declare objects with appropriate storage durations",[149,3213,3215],{"id":3214},"bibliography","Bibliography",[2606,3217,3219,3228],{"className":3218},[2677],[3220,3221,3222,3226],"colgroup",{},[3223,3224],"col",{"style":3225},"width: 50%",[3223,3227],{"style":3225},[2640,3229,3230,3245],{},[2614,3231,3233,3241],{"className":3232},[2707],[2645,3234,3235,3236,3240],{},"[ ",[43,3237,3239],{"href":3238},"\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Faa-bibliography#AA.Bibliography-Coverity07","Coverity 2007"," ]",[2645,3242,3243],{},[68,3244],{},[2614,3246,3248,3252],{"className":3247},[2750],[2645,3249,3235,3250,3240],{},[43,3251,54],{"href":53},[2645,3253,3254,3255,3257],{},"Subclause 3.8, \"Object Lifetime\"",[68,3256],{},"\nSubclause 8.5.4, \"List-Initialization\"",[3259,3260],"hr",{},[39,3262,3263,92,3270,92,3276],{},[43,3264,3266],{"href":3265},"\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp53-cpp",[3267,3268],"img",{"src":3269},"\u002Fattachments\u002F88046682\u002F88480621.png",[43,3271,3273],{"href":3272},"\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp\u002F",[3267,3274],{"src":3275},"\u002Fattachments\u002F88046682\u002F88475556.png",[43,3277,3279],{"href":3278},"\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp55-cpp",[3267,3280],{"src":3281},"\u002Fattachments\u002F88046682\u002F88475555.png",[3283,3284,3285],"style",{},"html pre.shiki code .sq6CD, html code.shiki .sq6CD{--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit;--shiki-sepia:#66D9EF;--shiki-sepia-font-style:italic}html pre.shiki code .sz2Vg, html code.shiki .sz2Vg{--shiki-default:#6F42C1;--shiki-default-text-decoration:inherit;--shiki-dark:#B392F0;--shiki-dark-text-decoration:inherit;--shiki-sepia:#A6E22E;--shiki-sepia-text-decoration:underline}html pre.shiki code .sMOD_, html code.shiki .sMOD_{--shiki-default:#24292E;--shiki-dark:#E1E4E8;--shiki-sepia:#F8F8F2}html pre.shiki code .srTi1, html code.shiki .srTi1{--shiki-default:#6F42C1;--shiki-dark:#B392F0;--shiki-sepia:#A6E22E}html pre.shiki code .sC2Qs, html code.shiki .sC2Qs{--shiki-default:#D73A49;--shiki-dark:#F97583;--shiki-sepia:#F92672}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}html.sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}html pre.shiki code .sTHNf, html code.shiki .sTHNf{--shiki-default:#E36209;--shiki-default-font-style:inherit;--shiki-dark:#FFAB70;--shiki-dark-font-style:inherit;--shiki-sepia:#FD971F;--shiki-sepia-font-style:italic}html pre.shiki code .s8-w5, html code.shiki .s8-w5{--shiki-default:#6A737D;--shiki-dark:#6A737D;--shiki-sepia:#88846F}html pre.shiki code .s7F3e, html code.shiki .s7F3e{--shiki-default:#005CC5;--shiki-dark:#79B8FF;--shiki-sepia:#AE81FF}html pre.shiki code .sstjo, html code.shiki .sstjo{--shiki-default:#032F62;--shiki-dark:#9ECBFF;--shiki-sepia:#E6DB74}html pre.shiki code .s_OQ2, html code.shiki .s_OQ2{--shiki-default:#6F42C1;--shiki-dark:#B392F0;--shiki-sepia:#F8F8F2}html pre.shiki code .s-m8C, html code.shiki .s-m8C{--shiki-default:#005CC5;--shiki-default-font-style:inherit;--shiki-dark:#79B8FF;--shiki-dark-font-style:inherit;--shiki-sepia:#66D9EF;--shiki-sepia-font-style:italic}",{"title":168,"searchDepth":190,"depth":190,"links":3287},[3288,3289,3290,3291,3292,3293,3294,3295,3296,3297,3298,3299,3300,3301,3303,3305,3306,3307,3308,3309],{"id":151,"depth":190,"text":152},{"id":256,"depth":190,"text":257},{"id":353,"depth":190,"text":152},{"id":532,"depth":190,"text":257},{"id":680,"depth":190,"text":152},{"id":814,"depth":190,"text":257},{"id":927,"depth":190,"text":152},{"id":1136,"depth":190,"text":257},{"id":1290,"depth":190,"text":152},{"id":1430,"depth":190,"text":257},{"id":1556,"depth":190,"text":152},{"id":1740,"depth":190,"text":257},{"id":1880,"depth":190,"text":152},{"id":2479,"depth":190,"text":3302},"Compliant Solution ( std::uninitialized_copy() )",{"id":2532,"depth":190,"text":3304},"Compliant Solution ( std::raw_storage_iterator )",{"id":2600,"depth":190,"text":2601},{"id":2672,"depth":190,"text":2673},{"id":3167,"depth":190,"text":3168},{"id":3185,"depth":190,"text":3186},{"id":3214,"depth":190,"text":3215},"Every object has a lifetime in which it can be used in a well-defined manner. The lifetime of an object begins when sufficient, properly aligned storage has been obtained for it and its initialization is complete. The lifetime of an object ends when a nontrivial destructor, if any, is called for the object and the storage for the object has been reused or released. Use of an object, or a pointer to an object, outside of its lifetime frequently results in undefined behavior .","md",{"tags":3313},[3314,3315,3316,3317,3318,3319,3320,3321],"review","review-dms","rule","nptc-aliasing","notes","review-ajb","nptc","exp","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp54-cpp",{"title":30,"description":3310},"5.sei-cert-cpp-coding-standard\u002F3.rules\u002F07.expressions-exp\u002F06.exp54-cpp","g3lRNFpFNFGN_ILmfb-MYl9jn99uAnxGuYIp2qwbjfg",[3327,3330],{"title":3328,"path":3265,"stem":3329,"children":-1},"EXP53-CPP. Do not read uninitialized memory","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F07.expressions-exp\u002F05.exp53-cpp",{"title":3331,"path":3278,"stem":3332,"children":-1},"EXP55-CPP. Do not access a cv-qualified object through a cv-unqualified type","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F07.expressions-exp\u002F07.exp55-cpp",[3334],{"title":3335,"path":3336,"stem":3337,"children":3338},"SEI CERT C++ Coding Standard","\u002Fsei-cert-cpp-coding-standard","5.sei-cert-cpp-coding-standard\u002F1.index",[3339,3340,3407,3802,4010,4020],{"title":3335,"path":3336,"stem":3337},{"title":3341,"path":3342,"stem":3343,"children":3344},"Front Matter","\u002Fsei-cert-cpp-coding-standard\u002Ffront-matter","5.sei-cert-cpp-coding-standard\u002F2.front-matter\u002F1.index",[3345,3346],{"title":3341,"path":3342,"stem":3343},{"title":3347,"path":3348,"stem":3349,"children":3350},"Introduction","\u002Fsei-cert-cpp-coding-standard\u002Ffront-matter\u002Fintroduction","5.sei-cert-cpp-coding-standard\u002F2.front-matter\u002F2.introduction\u002F01.index",[3351,3352,3356,3360,3364,3368,3372,3376,3380,3384,3388,3392,3396,3400,3404],{"title":3347,"path":3348,"stem":3349},{"title":3353,"path":3354,"stem":3355},"Scope","\u002Fsei-cert-cpp-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fscope","5.sei-cert-cpp-coding-standard\u002F2.front-matter\u002F2.introduction\u002F02.scope",{"title":3357,"path":3358,"stem":3359},"Audience","\u002Fsei-cert-cpp-coding-standard\u002Ffront-matter\u002Fintroduction\u002Faudience","5.sei-cert-cpp-coding-standard\u002F2.front-matter\u002F2.introduction\u002F03.audience",{"title":3361,"path":3362,"stem":3363},"Usage","\u002Fsei-cert-cpp-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fusage","5.sei-cert-cpp-coding-standard\u002F2.front-matter\u002F2.introduction\u002F04.usage",{"title":3365,"path":3366,"stem":3367},"How this Coding Standard Is Organized","\u002Fsei-cert-cpp-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fhow-this-coding-standard-is-organized","5.sei-cert-cpp-coding-standard\u002F2.front-matter\u002F2.introduction\u002F05.how-this-coding-standard-is-organized",{"title":3369,"path":3370,"stem":3371},"Relation to the CERT C Coding Standard","\u002Fsei-cert-cpp-coding-standard\u002Ffront-matter\u002Fintroduction\u002Frelation-to-the-cert-c-coding-standard","5.sei-cert-cpp-coding-standard\u002F2.front-matter\u002F2.introduction\u002F06.relation-to-the-cert-c-coding-standard",{"title":3373,"path":3374,"stem":3375},"Rules Versus Recommendations","\u002Fsei-cert-cpp-coding-standard\u002Ffront-matter\u002Fintroduction\u002Frules-versus-recommendations","5.sei-cert-cpp-coding-standard\u002F2.front-matter\u002F2.introduction\u002F07.rules-versus-recommendations",{"title":3377,"path":3378,"stem":3379},"Tool Selection and Validation","\u002Fsei-cert-cpp-coding-standard\u002Ffront-matter\u002Fintroduction\u002Ftool-selection-and-validation","5.sei-cert-cpp-coding-standard\u002F2.front-matter\u002F2.introduction\u002F08.tool-selection-and-validation",{"title":3381,"path":3382,"stem":3383},"Conformance Testing","\u002Fsei-cert-cpp-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fconformance-testing","5.sei-cert-cpp-coding-standard\u002F2.front-matter\u002F2.introduction\u002F09.conformance-testing",{"title":3385,"path":3386,"stem":3387},"Development Process","\u002Fsei-cert-cpp-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fdevelopment-process","5.sei-cert-cpp-coding-standard\u002F2.front-matter\u002F2.introduction\u002F10.development-process",{"title":3389,"path":3390,"stem":3391},"System Qualities","\u002Fsei-cert-cpp-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fsystem-qualities","5.sei-cert-cpp-coding-standard\u002F2.front-matter\u002F2.introduction\u002F11.system-qualities",{"title":3393,"path":3394,"stem":3395},"Automatically Generated Code","\u002Fsei-cert-cpp-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fautomatically-generated-code","5.sei-cert-cpp-coding-standard\u002F2.front-matter\u002F2.introduction\u002F12.automatically-generated-code",{"title":3397,"path":3398,"stem":3399},"Government Regulations","\u002Fsei-cert-cpp-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fgovernment-regulations","5.sei-cert-cpp-coding-standard\u002F2.front-matter\u002F2.introduction\u002F13.government-regulations",{"title":3401,"path":3402,"stem":3403},"Acknowledgments","\u002Fsei-cert-cpp-coding-standard\u002Ffront-matter\u002Fintroduction\u002Facknowledgments","5.sei-cert-cpp-coding-standard\u002F2.front-matter\u002F2.introduction\u002F14.acknowledgments",{"title":2673,"path":3405,"stem":3406},"\u002Fsei-cert-cpp-coding-standard\u002Ffront-matter\u002Fintroduction\u002Fautomated-detection","5.sei-cert-cpp-coding-standard\u002F2.front-matter\u002F2.introduction\u002F15.automated-detection",{"title":3408,"path":3409,"stem":3410,"children":3411},"Rules","\u002Fsei-cert-cpp-coding-standard\u002Frules","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F01.index",[3412,3413,3435,3469,3511,3561,3619,3672,3686,3696,3734,3760],{"title":3408,"path":3409,"stem":3410},{"title":3414,"path":3415,"stem":3416,"children":3417},"Characters and Strings (STR)","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fcharacters-and-strings-str","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F02.characters-and-strings-str\u002F1.index",[3418,3419,3423,3427,3431],{"title":3414,"path":3415,"stem":3416},{"title":3420,"path":3421,"stem":3422},"STR50-CPP. Guarantee that storage for strings has sufficient space for character data and the null terminator","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fcharacters-and-strings-str\u002Fstr50-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F02.characters-and-strings-str\u002F2.str50-cpp",{"title":3424,"path":3425,"stem":3426},"STR52-CPP. Use valid references, pointers, and iterators to reference elements of a basic_string","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fcharacters-and-strings-str\u002Fstr52-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F02.characters-and-strings-str\u002F3.str52-cpp",{"title":3428,"path":3429,"stem":3430},"STR53-CPP. Range check element access","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fcharacters-and-strings-str\u002Fstr53-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F02.characters-and-strings-str\u002F4.str53-cpp",{"title":3432,"path":3433,"stem":3434},"string from a null pointer","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fcharacters-and-strings-str\u002Fstring-from-a-null-pointer","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F02.characters-and-strings-str\u002F5.string-from-a-null-pointer",{"title":3436,"path":3437,"stem":3438,"children":3439},"Concurrency (CON)","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fconcurrency-con","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F03.concurrency-con\u002F1.index",[3440,3441,3445,3449,3453,3457,3461,3465],{"title":3436,"path":3437,"stem":3438},{"title":3442,"path":3443,"stem":3444},"CON50-CPP. Do not destroy a mutex while it is locked","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon50-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F03.concurrency-con\u002F2.con50-cpp",{"title":3446,"path":3447,"stem":3448},"CON51-CPP. Ensure actively held locks are released on exceptional conditions","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon51-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F03.concurrency-con\u002F3.con51-cpp",{"title":3450,"path":3451,"stem":3452},"CON52-CPP. Prevent data races when accessing bit-fields from multiple threads","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon52-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F03.concurrency-con\u002F4.con52-cpp",{"title":3454,"path":3455,"stem":3456},"CON53-CPP. Avoid deadlock by locking in a predefined order","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon53-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F03.concurrency-con\u002F5.con53-cpp",{"title":3458,"path":3459,"stem":3460},"CON54-CPP. Wrap functions that can spuriously wake up in a loop","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon54-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F03.concurrency-con\u002F6.con54-cpp",{"title":3462,"path":3463,"stem":3464},"CON55-CPP. Preserve thread safety and liveness when using condition variables","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon55-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F03.concurrency-con\u002F7.con55-cpp",{"title":3466,"path":3467,"stem":3468},"CON56-CPP. Do not speculatively lock a non-recursive mutex that is already owned by the calling thread","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fconcurrency-con\u002Fcon56-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F03.concurrency-con\u002F8.con56-cpp",{"title":3470,"path":3471,"stem":3472,"children":3473},"Containers (CTR)","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fcontainers-ctr","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F04.containers-ctr\u002F01.index",[3474,3475,3479,3483,3487,3491,3495,3499,3503,3507],{"title":3470,"path":3471,"stem":3472},{"title":3476,"path":3477,"stem":3478},"CTR50-CPP. Guarantee that container indices and iterators are within the valid range","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fcontainers-ctr\u002Fctr50-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F04.containers-ctr\u002F02.ctr50-cpp",{"title":3480,"path":3481,"stem":3482},"CTR51-CPP. Use valid references, pointers, and iterators to reference elements of a container","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fcontainers-ctr\u002Fctr51-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F04.containers-ctr\u002F03.ctr51-cpp",{"title":3484,"path":3485,"stem":3486},"CTR52-CPP. Guarantee that library functions do not overflow","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fcontainers-ctr\u002Fctr52-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F04.containers-ctr\u002F04.ctr52-cpp",{"title":3488,"path":3489,"stem":3490},"CTR53-CPP. Use valid iterator ranges","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fcontainers-ctr\u002Fctr53-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F04.containers-ctr\u002F05.ctr53-cpp",{"title":3492,"path":3493,"stem":3494},"CTR54-CPP. Do not subtract iterators that do not refer to the same container","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fcontainers-ctr\u002Fctr54-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F04.containers-ctr\u002F06.ctr54-cpp",{"title":3496,"path":3497,"stem":3498},"CTR55-CPP. Do not use an additive operator on an iterator if the result would overflow","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fcontainers-ctr\u002Fctr55-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F04.containers-ctr\u002F07.ctr55-cpp",{"title":3500,"path":3501,"stem":3502},"CTR56-CPP. Do not use pointer arithmetic on polymorphic objects","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fcontainers-ctr\u002Fctr56-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F04.containers-ctr\u002F08.ctr56-cpp",{"title":3504,"path":3505,"stem":3506},"CTR57-CPP. Provide a valid ordering predicate","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fcontainers-ctr\u002Fctr57-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F04.containers-ctr\u002F09.ctr57-cpp",{"title":3508,"path":3509,"stem":3510},"CTR58-CPP. Predicate function objects should not be mutable","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fcontainers-ctr\u002Fctr58-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F04.containers-ctr\u002F10.ctr58-cpp",{"title":3512,"path":3513,"stem":3514,"children":3515},"Declarations and Initialization (DCL)","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F05.declarations-and-initialization-dcl\u002F01.index",[3516,3517,3521,3525,3529,3533,3537,3541,3545,3549,3553,3557],{"title":3512,"path":3513,"stem":3514},{"title":3518,"path":3519,"stem":3520},"DCL50-CPP. Do not define a C-style variadic function","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl50-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F05.declarations-and-initialization-dcl\u002F02.dcl50-cpp",{"title":3522,"path":3523,"stem":3524},"DCL51-CPP. Do not declare or define a reserved identifier","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl51-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F05.declarations-and-initialization-dcl\u002F03.dcl51-cpp",{"title":3526,"path":3527,"stem":3528},"DCL52-CPP. Never qualify a reference type with const or volatile","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl52-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F05.declarations-and-initialization-dcl\u002F04.dcl52-cpp",{"title":3530,"path":3531,"stem":3532},"DCL53-CPP. Do not write syntactically ambiguous declarations","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl53-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F05.declarations-and-initialization-dcl\u002F05.dcl53-cpp",{"title":3534,"path":3535,"stem":3536},"DCL54-CPP. Overload allocation and deallocation functions as a pair in the same scope","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl54-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F05.declarations-and-initialization-dcl\u002F06.dcl54-cpp",{"title":3538,"path":3539,"stem":3540},"DCL55-CPP. Avoid information leakage when passing a class object across a trust boundary","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl55-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F05.declarations-and-initialization-dcl\u002F07.dcl55-cpp",{"title":3542,"path":3543,"stem":3544},"DCL56-CPP. Avoid cycles during initialization of static objects","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl56-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F05.declarations-and-initialization-dcl\u002F08.dcl56-cpp",{"title":3546,"path":3547,"stem":3548},"DCL57-CPP. Do not let exceptions escape from destructors or deallocation functions","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl57-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F05.declarations-and-initialization-dcl\u002F09.dcl57-cpp",{"title":3550,"path":3551,"stem":3552},"DCL58-CPP. Do not modify the standard namespaces","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl58-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F05.declarations-and-initialization-dcl\u002F10.dcl58-cpp",{"title":3554,"path":3555,"stem":3556},"DCL59-CPP. Do not define an unnamed namespace in a header file","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl59-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F05.declarations-and-initialization-dcl\u002F11.dcl59-cpp",{"title":3558,"path":3559,"stem":3560},"DCL60-CPP. Obey the one-definition rule","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fdeclarations-and-initialization-dcl\u002Fdcl60-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F05.declarations-and-initialization-dcl\u002F12.dcl60-cpp",{"title":3562,"path":3563,"stem":3564,"children":3565},"Exceptions and Error Handling (ERR)","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexceptions-and-error-handling-err","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F06.exceptions-and-error-handling-err\u002F01.index",[3566,3567,3571,3575,3579,3583,3587,3591,3595,3599,3603,3607,3611,3615],{"title":3562,"path":3563,"stem":3564},{"title":3568,"path":3569,"stem":3570},"ERR50-CPP. Do not abruptly terminate the program","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexceptions-and-error-handling-err\u002Ferr50-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F06.exceptions-and-error-handling-err\u002F02.err50-cpp",{"title":3572,"path":3573,"stem":3574},"ERR51-CPP. Handle all exceptions","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexceptions-and-error-handling-err\u002Ferr51-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F06.exceptions-and-error-handling-err\u002F03.err51-cpp",{"title":3576,"path":3577,"stem":3578},"ERR52-CPP. Do not use setjmp() or longjmp()","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexceptions-and-error-handling-err\u002Ferr52-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F06.exceptions-and-error-handling-err\u002F04.err52-cpp",{"title":3580,"path":3581,"stem":3582},"ERR53-CPP. Do not reference base classes or class data members in a constructor or destructor function-try-block handler","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexceptions-and-error-handling-err\u002Ferr53-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F06.exceptions-and-error-handling-err\u002F05.err53-cpp",{"title":3584,"path":3585,"stem":3586},"ERR54-CPP. Catch handlers should order their parameter types from most derived to least derived","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexceptions-and-error-handling-err\u002Ferr54-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F06.exceptions-and-error-handling-err\u002F06.err54-cpp",{"title":3588,"path":3589,"stem":3590},"ERR55-CPP. Honor exception specifications","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexceptions-and-error-handling-err\u002Ferr55-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F06.exceptions-and-error-handling-err\u002F07.err55-cpp",{"title":3592,"path":3593,"stem":3594},"ERR56-CPP. Guarantee exception safety","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexceptions-and-error-handling-err\u002Ferr56-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F06.exceptions-and-error-handling-err\u002F08.err56-cpp",{"title":3596,"path":3597,"stem":3598},"ERR57-CPP. Do not leak resources when handling exceptions","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexceptions-and-error-handling-err\u002Ferr57-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F06.exceptions-and-error-handling-err\u002F09.err57-cpp",{"title":3600,"path":3601,"stem":3602},"ERR58-CPP. Handle all exceptions thrown before main() begins executing","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexceptions-and-error-handling-err\u002Ferr58-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F06.exceptions-and-error-handling-err\u002F10.err58-cpp",{"title":3604,"path":3605,"stem":3606},"ERR59-CPP. Do not throw an exception across execution boundaries","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexceptions-and-error-handling-err\u002Ferr59-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F06.exceptions-and-error-handling-err\u002F11.err59-cpp",{"title":3608,"path":3609,"stem":3610},"ERR60-CPP. Exception objects must be nothrow copy constructible","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexceptions-and-error-handling-err\u002Ferr60-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F06.exceptions-and-error-handling-err\u002F12.err60-cpp",{"title":3612,"path":3613,"stem":3614},"ERR61-CPP. Catch exceptions by lvalue reference","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexceptions-and-error-handling-err\u002Ferr61-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F06.exceptions-and-error-handling-err\u002F13.err61-cpp",{"title":3616,"path":3617,"stem":3618},"ERR62-CPP. Detect errors when converting a string to a number","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexceptions-and-error-handling-err\u002Ferr62-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F06.exceptions-and-error-handling-err\u002F14.err62-cpp",{"title":3620,"path":3621,"stem":3622,"children":3623},"Expressions (EXP)","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F07.expressions-exp\u002F01.index",[3624,3625,3629,3633,3637,3638,3639,3640,3644,3648,3652,3656,3660,3664,3668],{"title":3620,"path":3621,"stem":3622},{"title":3626,"path":3627,"stem":3628},"EXP50-CPP. Do not depend on the order of evaluation for side effects","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp50-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F07.expressions-exp\u002F02.exp50-cpp",{"title":3630,"path":3631,"stem":3632},"EXP51-CPP. Do not delete an array through a pointer of the incorrect type","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp51-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F07.expressions-exp\u002F03.exp51-cpp",{"title":3634,"path":3635,"stem":3636},"EXP52-CPP. Do not rely on side effects in unevaluated operands","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp52-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F07.expressions-exp\u002F04.exp52-cpp",{"title":3328,"path":3265,"stem":3329},{"title":30,"path":3322,"stem":3324},{"title":3331,"path":3278,"stem":3332},{"title":3641,"path":3642,"stem":3643},"EXP56-CPP. Do not call a function with a mismatched language linkage","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp56-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F07.expressions-exp\u002F08.exp56-cpp",{"title":3645,"path":3646,"stem":3647},"EXP57-CPP. Do not cast or delete pointers to incomplete classes","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp57-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F07.expressions-exp\u002F09.exp57-cpp",{"title":3649,"path":3650,"stem":3651},"EXP58-CPP. Pass an object of the correct type to va_start","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp58-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F07.expressions-exp\u002F10.exp58-cpp",{"title":3653,"path":3654,"stem":3655},"EXP59-CPP. Use offsetof() on valid types and members","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp59-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F07.expressions-exp\u002F11.exp59-cpp",{"title":3657,"path":3658,"stem":3659},"EXP60-CPP. Do not pass a nonstandard-layout type object across execution boundaries","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp60-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F07.expressions-exp\u002F12.exp60-cpp",{"title":3661,"path":3662,"stem":3663},"EXP61-CPP. A lambda object must not outlive any of its reference captured objects","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp61-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F07.expressions-exp\u002F13.exp61-cpp",{"title":3665,"path":3666,"stem":3667},"EXP62-CPP. Do not access the bits of an object representation that are not part of the object's value representation","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp62-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F07.expressions-exp\u002F14.exp62-cpp",{"title":3669,"path":3670,"stem":3671},"EXP63-CPP. Do not rely on the value of a moved-from object","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fexpressions-exp\u002Fexp63-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F07.expressions-exp\u002F15.exp63-cpp",{"title":3673,"path":3674,"stem":3675,"children":3676},"Input Output (FIO)","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Finput-output-fio","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F08.input-output-fio\u002F1.index",[3677,3678,3682],{"title":3673,"path":3674,"stem":3675},{"title":3679,"path":3680,"stem":3681},"FIO50-CPP. Do not alternately input and output from a file stream without an intervening positioning call","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Finput-output-fio\u002Ffio50-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F08.input-output-fio\u002F2.fio50-cpp",{"title":3683,"path":3684,"stem":3685},"FIO51-CPP. Close files when they are no longer needed","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Finput-output-fio\u002Ffio51-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F08.input-output-fio\u002F3.fio51-cpp",{"title":3687,"path":3688,"stem":3689,"children":3690},"Integers (INT)","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fintegers-int","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F09.integers-int\u002F1.index",[3691,3692],{"title":3687,"path":3688,"stem":3689},{"title":3693,"path":3694,"stem":3695},"INT50-CPP. Do not cast to an out-of-range enumeration value","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fintegers-int\u002Fint50-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F09.integers-int\u002F2.int50-cpp",{"title":3697,"path":3698,"stem":3699,"children":3700},"Memory Management (MEM)","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fmemory-management-mem","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F10.memory-management-mem\u002F1.index",[3701,3702,3706,3710,3714,3718,3722,3726,3730],{"title":3697,"path":3698,"stem":3699},{"title":3703,"path":3704,"stem":3705},"MEM50-CPP. Do not access freed memory","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fmemory-management-mem\u002Fmem50-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F10.memory-management-mem\u002F2.mem50-cpp",{"title":3707,"path":3708,"stem":3709},"MEM51-CPP. Properly deallocate dynamically allocated resources","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fmemory-management-mem\u002Fmem51-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F10.memory-management-mem\u002F3.mem51-cpp",{"title":3711,"path":3712,"stem":3713},"MEM52-CPP. Detect and handle memory allocation errors","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fmemory-management-mem\u002Fmem52-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F10.memory-management-mem\u002F4.mem52-cpp",{"title":3715,"path":3716,"stem":3717},"MEM53-CPP. Explicitly construct and destruct objects when manually managing object lifetime","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fmemory-management-mem\u002Fmem53-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F10.memory-management-mem\u002F5.mem53-cpp",{"title":3719,"path":3720,"stem":3721},"MEM54-CPP. Provide placement new with properly aligned pointers to sufficient storage capacity","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fmemory-management-mem\u002Fmem54-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F10.memory-management-mem\u002F6.mem54-cpp",{"title":3723,"path":3724,"stem":3725},"MEM55-CPP. Honor replacement dynamic storage management requirements","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fmemory-management-mem\u002Fmem55-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F10.memory-management-mem\u002F7.mem55-cpp",{"title":3727,"path":3728,"stem":3729},"MEM56-CPP. Do not store an already-owned pointer value in an unrelated smart pointer","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fmemory-management-mem\u002Fmem56-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F10.memory-management-mem\u002F8.mem56-cpp",{"title":3731,"path":3732,"stem":3733},"MEM57-CPP. Avoid using default operator new for over-aligned types","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fmemory-management-mem\u002Fmem57-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F10.memory-management-mem\u002F9.mem57-cpp",{"title":3735,"path":3736,"stem":3737,"children":3738},"Miscellaneous (MSC)","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fmiscellaneous-msc","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F11.miscellaneous-msc\u002F1.index",[3739,3740,3744,3748,3752,3756],{"title":3735,"path":3736,"stem":3737},{"title":3741,"path":3742,"stem":3743},"MSC51-CPP. Ensure your random number generator is properly seeded","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fmiscellaneous-msc\u002Fmsc51-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F11.miscellaneous-msc\u002F2.msc51-cpp",{"title":3745,"path":3746,"stem":3747},"MSC52-CPP. Value-returning functions must return a value from all exit paths","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fmiscellaneous-msc\u002Fmsc52-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F11.miscellaneous-msc\u002F3.msc52-cpp",{"title":3749,"path":3750,"stem":3751},"MSC53-CPP. Do not return from a function declared [[noreturn]]","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fmiscellaneous-msc\u002Fmsc53-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F11.miscellaneous-msc\u002F4.msc53-cpp",{"title":3753,"path":3754,"stem":3755},"MSC54-CPP. A signal handler must be a plain old function","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fmiscellaneous-msc\u002Fmsc54-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F11.miscellaneous-msc\u002F5.msc54-cpp",{"title":3757,"path":3758,"stem":3759},"rand() for generating pseudorandom numbers","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fmiscellaneous-msc\u002Frand-for-generating-pseudorandom-numbers","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F11.miscellaneous-msc\u002F6.rand-for-generating-pseudorandom-numbers",{"title":3761,"path":3762,"stem":3763,"children":3764},"Object Oriented Programming (OOP)","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fobject-oriented-programming-oop","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F12.object-oriented-programming-oop\u002F01.index",[3765,3766,3770,3774,3778,3782,3786,3790,3794,3798],{"title":3761,"path":3762,"stem":3763},{"title":3767,"path":3768,"stem":3769},"OOP50-CPP. Do not invoke virtual functions from constructors or destructors","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fobject-oriented-programming-oop\u002Foop50-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F12.object-oriented-programming-oop\u002F02.oop50-cpp",{"title":3771,"path":3772,"stem":3773},"OOP51-CPP. Do not slice derived objects","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fobject-oriented-programming-oop\u002Foop51-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F12.object-oriented-programming-oop\u002F03.oop51-cpp",{"title":3775,"path":3776,"stem":3777},"OOP52-CPP. Do not delete a polymorphic object without a virtual destructor","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fobject-oriented-programming-oop\u002Foop52-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F12.object-oriented-programming-oop\u002F04.oop52-cpp",{"title":3779,"path":3780,"stem":3781},"OOP53-CPP. Write constructor member initializers in the canonical order","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fobject-oriented-programming-oop\u002Foop53-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F12.object-oriented-programming-oop\u002F05.oop53-cpp",{"title":3783,"path":3784,"stem":3785},"OOP54-CPP. Gracefully handle self-copy assignment","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fobject-oriented-programming-oop\u002Foop54-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F12.object-oriented-programming-oop\u002F06.oop54-cpp",{"title":3787,"path":3788,"stem":3789},"OOP55-CPP. Do not use pointer-to-member operators to access nonexistent members","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fobject-oriented-programming-oop\u002Foop55-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F12.object-oriented-programming-oop\u002F07.oop55-cpp",{"title":3791,"path":3792,"stem":3793},"OOP56-CPP. Honor replacement handler requirements","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fobject-oriented-programming-oop\u002Foop56-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F12.object-oriented-programming-oop\u002F08.oop56-cpp",{"title":3795,"path":3796,"stem":3797},"OOP57-CPP. Prefer special member functions and overloaded operators to C Standard Library functions","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fobject-oriented-programming-oop\u002Foop57-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F12.object-oriented-programming-oop\u002F09.oop57-cpp",{"title":3799,"path":3800,"stem":3801},"OOP58-CPP. Copy operations must not mutate the source object","\u002Fsei-cert-cpp-coding-standard\u002Frules\u002Fobject-oriented-programming-oop\u002Foop58-cpp","5.sei-cert-cpp-coding-standard\u002F3.rules\u002F12.object-oriented-programming-oop\u002F10.oop58-cpp",{"title":3803,"path":3804,"stem":3805,"children":3806},"Back Matter","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F1.index",[3807,3808,3812,3816,3992,4006],{"title":3803,"path":3804,"stem":3805},{"title":3809,"path":3810,"stem":3811},"AA. Bibliography","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Faa-bibliography","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F2.aa-bibliography",{"title":3813,"path":3814,"stem":3815},"BB. Definitions","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fbb-definitions","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F3.bb-definitions",{"title":3817,"path":3818,"stem":3819,"children":3820},"CC. Analyzers","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F01.index",[3821,3822,3824,3828,3832,3836,3838,3842,3846,3850,3854,3858,3862,3864,3868,3872,3876,3880,3884,3888,3892,3896,3900,3902,3906,3908,3912,3915,3919,3922,3926,3928,3932,3936,3940,3942,3946,3950,3954,3956,3960,3964,3968,3972,3976,3980,3984,3988],{"title":3817,"path":3818,"stem":3819},{"title":2713,"path":2712,"stem":3823},"5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F02.astree",{"title":3825,"path":3826,"stem":3827},"Astrée_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fastree_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F03.astree_v",{"title":3829,"path":3830,"stem":3831},"Axivion Bauhaus Suite","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Faxivion-bauhaus-suite","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F04.axivion-bauhaus-suite",{"title":3833,"path":3834,"stem":3835},"Axivion Bauhaus Suite_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Faxivion-bauhaus-suite_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F05.axivion-bauhaus-suite_v",{"title":2756,"path":2755,"stem":3837},"5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F06.clang",{"title":3839,"path":3840,"stem":3841},"Clang_38_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fclang_38_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F07.clang_38_v",{"title":3843,"path":3844,"stem":3845},"Clang_39_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fclang_39_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F08.clang_39_v",{"title":3847,"path":3848,"stem":3849},"Clang_40_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fclang_40_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F09.clang_40_v",{"title":3851,"path":3852,"stem":3853},"Clang_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fclang_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F10.clang_v",{"title":3855,"path":3856,"stem":3857},"Codee","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fcodee","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F11.codee",{"title":3859,"path":3860,"stem":3861},"Codee_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fcodee_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F12.codee_v",{"title":2784,"path":2783,"stem":3863},"5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F13.codesonar",{"title":3865,"path":3866,"stem":3867},"CodeSonar_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fcodesonar_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F14.codesonar_v",{"title":3869,"path":3870,"stem":3871},"Coverity","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fcoverity","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F15.coverity",{"title":3873,"path":3874,"stem":3875},"Coverity_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fcoverity_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F16.coverity_v",{"title":3877,"path":3878,"stem":3879},"ECLAIR","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Feclair","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F17.eclair",{"title":3881,"path":3882,"stem":3883},"ECLAIR_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Feclair_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F18.eclair_v",{"title":3885,"path":3886,"stem":3887},"EDG","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fedg","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F19.edg",{"title":3889,"path":3890,"stem":3891},"Edg_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fedg_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F20.edg_v",{"title":3893,"path":3894,"stem":3895},"GCC","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fgcc","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F21.gcc",{"title":3897,"path":3898,"stem":3899},"Gcc_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fgcc_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F22.gcc_v",{"title":2815,"path":2814,"stem":3901},"5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F23.helix-qac",{"title":3903,"path":3904,"stem":3905},"Helix QAC_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fhelix-qac_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F24.helix-qac_v",{"title":2848,"path":2847,"stem":3907},"5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F25.klocwork",{"title":3909,"path":3910,"stem":3911},"Klocwork_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fklocwork_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F26.klocwork_v",{"title":3913,"path":2965,"stem":3914},"LDRA","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F27.ldra",{"title":3916,"path":3917,"stem":3918},"Ldra_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fldra_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F28.ldra_v",{"title":3920,"path":2996,"stem":3921},"Parasoft","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F29.parasoft",{"title":3923,"path":3924,"stem":3925},"Parasoft_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fparasoft_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F30.parasoft_v",{"title":3058,"path":3057,"stem":3927},"5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F31.polyspace-bug-finder",{"title":3929,"path":3930,"stem":3931},"Polyspace Bug Finder_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fpolyspace-bug-finder_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F32.polyspace-bug-finder_v",{"title":3933,"path":3934,"stem":3935},"PRQA QA-C++","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fprqa-qa-cpp","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F33.prqa-qa-cpp",{"title":3937,"path":3938,"stem":3939},"PRQA QA-C++_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fprqa-qa-cpp_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F34.prqa-qa-cpp_v",{"title":3105,"path":3104,"stem":3941},"5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F35.pvs-studio",{"title":3943,"path":3944,"stem":3945},"PVS-Studio_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fpvs-studio_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F36.pvs-studio_v",{"title":3947,"path":3948,"stem":3949},"Rose","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Frose","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F37.rose",{"title":3951,"path":3952,"stem":3953},"Rose_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Frose_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F38.rose_v",{"title":3147,"path":3146,"stem":3955},"5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F39.rulechecker",{"title":3957,"path":3958,"stem":3959},"RuleChecker_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Frulechecker_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F40.rulechecker_v",{"title":3961,"path":3962,"stem":3963},"Security Reviewer - Static Reviewer","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fsecurity-reviewer-static-reviewer","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F41.security-reviewer-static-reviewer",{"title":3965,"path":3966,"stem":3967},"Security Reviewer - Static Reviewer_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fsecurity-reviewer-static-reviewer_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F42.security-reviewer-static-reviewer_v",{"title":3969,"path":3970,"stem":3971},"Semgrep","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fsemgrep","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F43.semgrep",{"title":3973,"path":3974,"stem":3975},"Semgrep_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fsemgrep_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F44.semgrep_v",{"title":3977,"path":3978,"stem":3979},"SonarQube C\u002FC++ Plugin","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fsonarqube-ccpp-plugin","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F45.sonarqube-ccpp-plugin",{"title":3981,"path":3982,"stem":3983},"SonarQube C\u002FC++ Plugin_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fsonarqube-ccpp-plugin_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F46.sonarqube-ccpp-plugin_v",{"title":3985,"path":3986,"stem":3987},"Splint","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fsplint","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F47.splint",{"title":3989,"path":3990,"stem":3991},"Splint_V","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fcc-analyzers\u002Fsplint_v","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F4.cc-analyzers\u002F48.splint_v",{"title":3993,"path":3994,"stem":3995,"children":3996},"DD. Related Guidelines","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fdd-related-guidelines","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F5.dd-related-guidelines\u002F1.index",[3997,3998,4002],{"title":3993,"path":3994,"stem":3995},{"title":3999,"path":4000,"stem":4001},"2008","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fdd-related-guidelines\u002F2.2008","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F5.dd-related-guidelines\u002F2.2008",{"title":4003,"path":4004,"stem":4005},"MITRE CWE","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fdd-related-guidelines\u002Fmitre-cwe","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F5.dd-related-guidelines\u002F3.mitre-cwe",{"title":4007,"path":4008,"stem":4009},"EE. Risk Assessments","\u002Fsei-cert-cpp-coding-standard\u002Fback-matter\u002Fee-risk-assessments","5.sei-cert-cpp-coding-standard\u002F4.back-matter\u002F6.ee-risk-assessments",{"title":4011,"path":4012,"stem":4013,"children":4014},"Admin","\u002Fsei-cert-cpp-coding-standard\u002Fadmin","5.sei-cert-cpp-coding-standard\u002F5.admin\u002F1.index",[4015,4016],{"title":4011,"path":4012,"stem":4013},{"title":4017,"path":4018,"stem":4019},"TODO List","\u002Fsei-cert-cpp-coding-standard\u002Fadmin\u002Ftodo-list","5.sei-cert-cpp-coding-standard\u002F5.admin\u002F2.todo-list",{"title":4021,"path":4022,"stem":4023},"Errata for SEI CERT C++ Coding Standard (2016 Edition)","\u002Fsei-cert-cpp-coding-standard\u002Ferrata-for-sei-cert-cpp-coding-standard-2016-edition","5.sei-cert-cpp-coding-standard\u002F6.errata-for-sei-cert-cpp-coding-standard-2016-edition",1775657781502]