1# 2# Series 2. 3# 4 5-doc_begin="The compiler implementation guarantees that the unreachable code is removed. 6Constant expressions and unreachable branches of if and switch statements are expected." 7-config=MC3A2.R2.1,+reports={safe,"first_area(^.*has an invariantly.*$)"} 8-config=MC3A2.R2.1,+reports={safe,"first_area(^.*incompatible with labeled statement$)"} 9-doc_end 10 11-doc_begin="Unreachability caused by calls to the following functions or macros is deliberate and there is no risk of code being unexpectedly left out." 12-config=MC3A2.R2.1,statements+={deliberate,"macro(name(BUG||assert_failed))"} 13-config=MC3A2.R2.1,statements+={deliberate, "call(decl(name(__builtin_unreachable||panic||do_unexpected_trap||machine_halt||machine_restart||reboot_or_halt)))"} 14-doc_end 15 16-doc_begin="Unreachability inside an ASSERT_UNREACHABLE() and analogous macro calls is deliberate and safe." 17-config=MC3A2.R2.1,reports+={deliberate, "any_area(any_loc(any_exp(macro(name(ASSERT_UNREACHABLE||PARSE_ERR_RET||PARSE_ERR||FAIL_MSR||FAIL_CPUID)))))"} 18-doc_end 19 20-doc_begin="Pure declarations (i.e., declarations without initialization) are 21not executable, and therefore it is safe for them to be unreachable." 22-config=MC3A2.R2.1,ignored_stmts+={"any()", "pure_decl()"} 23-doc_end 24 25-doc_begin="The following autogenerated file is not linked deliberately." 26-file_tag+={C_runtime_failures,"^automation/eclair_analysis/C-runtime-failures\\.rst\\.c$"} 27-config=MC3A2.R2.1,reports+={deliberate, "any_area(any_loc(file(C_runtime_failures)))"} 28-doc_end 29 30-doc_begin="Proving compliance with respect to Rule 2.2 is generally impossible: 31see https://arxiv.org/abs/2212.13933 for details. Moreover, peer review gives us 32confidence that no evidence of errors in the program's logic has been missed due 33to undetected violations of Rule 2.2, if any. Testing on time behavior gives us 34confidence on the fact that, should the program contain dead code that is not 35removed by the compiler, the resulting slowdown is negligible." 36-config=MC3A2.R2.2,reports+={disapplied,"any()"} 37-doc_end 38 39-doc_begin="Some labels are unused in certain build configurations, or are deliberately marked as unused, so that the compiler is entitled to remove them." 40-config=MC3A2.R2.6,reports+={deliberate, "any_area(text(^.*__maybe_unused.*$))"} 41-doc_end 42 43# 44# Series 3. 45# 46 47-doc_begin="Comments starting with '/*' and containing hyperlinks are safe as 48they are not instances of commented-out code." 49-config=MC3A2.R3.1,reports+={safe, "first_area(text(^.*https?://.*$))"} 50-doc_end 51 52# 53# Series 4. 54# 55 56-doc_begin="Files that are intended to be included more than once do not need to 57conform to the directive." 58-config=MC3A2.D4.10,reports+={safe, "first_area(text(^/\\* This file is intended to be included multiple times\\. \\*/$, begin-4))"} 59-config=MC3A2.D4.10,reports+={safe, "first_area(text(^/\\* Generated file, do not edit! \\*/$, begin-3))"} 60-config=MC3A2.D4.10,reports+={safe, "all_area(all_loc(file(^zephyr/build/zephyr/include/generated/autoconf\\.h$)))"} 61-doc_end 62 63-doc_begin="Including multiple times a .c file is safe because every function or data item 64it defines would (in the common case) be already defined. Peer reviewed by the community." 65-config=MC3A2.D4.10,reports+={safe, "all_area(all_loc(^.*\\.c$))"} 66-doc_end 67 68# 69# Series 5. 70# 71 72-doc_begin="The project adopted the rule with an exception listed in 73'docs/misra/rules.rst'" 74-config=MC3A2.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^READ_SYSREG$))&&any_exp(macro(^WRITE_SYSREG$))))"} 75-config=MC3A2.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^max(_t)?$))&&any_exp(macro(^min(_t)?$))))"} 76-config=MC3A2.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^read[bwlq]$))&&any_exp(macro(^read[bwlq]_relaxed$))))"} 77-config=MC3A2.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^per_cpu$))&&any_exp(macro(^this_cpu$))))"} 78-config=MC3A2.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^__emulate_2op$))&&any_exp(macro(^__emulate_2op_nobyte$))))"} 79-config=MC3A2.R5.3,reports+={safe, "any_area(any_loc(any_exp(macro(^read_debugreg$))&&any_exp(macro(^write_debugreg$))))"} 80-doc_end 81 82-doc_begin="Macros expanding to their own identifier (e.g., \"#define x x\") are deliberate." 83-config=MC3A2.R5.5,reports+={deliberate, "all_area(macro(same_id_body())||!macro(!same_id_body()))"} 84-doc_end 85 86-doc_begin="There is no clash between function like macros and not callable objects." 87-config=MC3A2.R5.5,reports+={deliberate, "all_area(macro(function_like())||decl(any()))&&all_area(macro(any())||!decl(kind(function))&&!decl(__function_pointer_decls))"} 88-doc_end 89 90-doc_begin="The project intentionally reuses tag names in order to have identifiers matching the applicable external specifications as well as established internal conventions. 91As there is little possibility for developer confusion not resulting into compilation errors, the risk of renaming outweighs the potential advantages of compliance." 92-config=MC3A2.R5.7,reports+={deliberate,"any()"} 93-doc_end 94 95# 96# Series 7. 97# 98 99-doc_begin="It is safe to use certain octal constants the way they are defined 100in specifications, manuals, and algorithm descriptions." 101-config=MC3A2.R7.1,reports+={safe, "any_area(any_loc(any_exp(text(^.*octal-ok.*$))))"} 102-doc_end 103 104-doc_begin="Allow pointers of non-character type as long as the pointee is 105const-qualified." 106-config=MC3A2.R7.4,same_pointee=false 107-doc_end 108 109# 110# Series 8. 111# 112 113-doc_begin="Parameter name \"unused\" (with an optional numeric suffix) is deliberate and makes explicit the intention of not using such parameter within the function." 114-config=MC3A2.R8.3,reports+={deliberate, "any_area(^.*parameter `unused[0-9]*'.*$)"} 115-doc_end 116 117-doc_begin="asmlinkage is a marker to indicate that the function is only used to interface with asm modules." 118-config=MC3A2.R8.4,declarations+={safe,"loc(text(^(?s).*asmlinkage.*$, -1..0))"} 119-doc_end 120 121-doc_begin="Declarations without definitions are allowed (specifically when the 122definition is compiled-out or optimized-out by the compiler)" 123-config=MC3A2.R8.6,reports+={deliberate, "first_area(^.*has no definition$)"} 124-doc_end 125 126# 127# Series 9. 128# 129 130-doc_begin="The possibility of committing mistakes by specifying an explicit 131dimension is higher than omitting the dimension." 132-config=MC3A2.R9.5,reports+={deliberate, "any()"} 133-doc_end 134 135# 136# Series 10. 137# 138 139-doc_begin="The value-preserving conversions of integer constants are safe" 140-config=MC3A2.R10.1,etypes={safe,"any()","preserved_integer_constant()"} 141-config=MC3A2.R10.3,etypes={safe,"any()","preserved_integer_constant()"} 142-config=MC3A2.R10.4,etypes={safe,"any()","preserved_integer_constant()||sibling(rhs,preserved_integer_constant())"} 143-doc_end 144 145-doc_begin="Shifting non-negative integers to the right is safe." 146-config=MC3A2.R10.1,etypes+={safe, 147 "stmt(node(binary_operator)&&operator(shr))", 148 "src_expr(definitely_in(0..))"} 149-doc_end 150 151-doc_begin="Shifting non-negative integers to the left is safe if the result is 152still non-negative." 153-config=MC3A2.R10.1,etypes+={safe, 154 "stmt(node(binary_operator)&&operator(shl)&&definitely_in(0..))", 155 "src_expr(definitely_in(0..))"} 156-doc_end 157 158-doc_begin="Bitwise logical operations on non-negative integers are safe." 159-config=MC3A2.R10.1,etypes+={safe, 160 "stmt(node(binary_operator)&&operator(and||or||xor))", 161 "src_expr(definitely_in(0..))"} 162-doc_end 163 164-doc_begin="The implicit conversion to Boolean for logical operator arguments is well known to all Zephyr developers to be a comparison with 0" 165-config=MC3A2.R10.1,etypes+={safe, "stmt(operator(logical)||node(conditional_operator||binary_conditional_operator))", "dst_type(ebool||boolean)"} 166-doc_end 167 168-doc_begin="Zephyr only supports architectures where signed integers are 169representend using two's complement and all the Xephyr developers are aware of 170this." 171-config=MC3A2.R10.1,etypes+={safe, 172 "stmt(operator(and||or||xor||not||and_assign||or_assign||xor_assign))", 173 "any()"} 174-doc_end 175 176-doc_begin="See Section \"4.5 Integers\" of \"GCC_MANUAL\", where it says that 177\"Signed `>>' acts on negative numbers by sign extension. As an extension to the 178C language, GCC does not use the latitude given in C99 and C11 only to treat 179certain aspects of signed `<<' as undefined. However, -fsanitize=shift (and 180-fsanitize=undefined) will diagnose such cases. They are also diagnosed where 181constant expressions are required.\"" 182-config=MC3A2.R10.1,etypes+={safe, 183 "stmt(operator(shl||shr||shl_assign||shr_assign))", 184 "any()"} 185-doc_end 186 187# 188# Series 11 189# 190 191-doc_begin="The conversion from a function pointer to unsigned long or (void *) does not lose any information, provided that the target type has enough bits to store it." 192-config=MC3A2.R11.1,casts+={safe, 193 "from(type(canonical(__function_pointer_types))) 194 &&to(type(canonical(builtin(unsigned long)||pointer(builtin(void))))) 195 &&relation(definitely_preserves_value)" 196} 197-doc_end 198 199-doc_begin="The conversion from a function pointer to a boolean has a well-known semantics that do not lead to unexpected behaviour." 200-config=MC3A2.R11.1,casts+={safe, 201 "from(type(canonical(__function_pointer_types))) 202 &&kind(pointer_to_boolean)" 203} 204-doc_end 205 206-doc_begin="The conversion from a pointer to an incomplete type to unsigned long does not lose any information, provided that the target type has enough bits to store it." 207-config=MC3A2.R11.2,casts+={safe, 208 "from(type(any())) 209 &&to(type(canonical(builtin(unsigned long)))) 210 &&relation(definitely_preserves_value)" 211} 212-doc_end 213 214-doc_begin="Conversions to object pointers that have a pointee type with a smaller (i.e., less strict) alignment requirement are safe." 215-config=MC3A2.R11.3,casts+={safe, 216 "!relation(more_aligned_pointee)" 217} 218-doc_end 219 220-doc_begin="Conversions from and to integral types are safe, in the assumption that the target type has enough bits to store the value. 221See also Section \"4.7 Arrays and Pointers\" of \"GCC_MANUAL\"" 222-config=MC3A2.R11.6,casts+={safe, 223 "(from(type(canonical(integral())))||to(type(canonical(integral())))) 224 &&relation(definitely_preserves_value)"} 225-doc_end 226 227-doc_begin="The conversion from a pointer to a boolean has a well-known semantics that do not lead to unexpected behaviour." 228-config=MC3A2.R11.6,casts+={safe, 229 "from(type(canonical(__pointer_types))) 230 &&kind(pointer_to_boolean)" 231} 232-doc_end 233 234-doc_begin="Violations caused by container_of are due to pointer arithmetic operations 235with the provided offset. The resulting pointer is then immediately cast back to its 236original type, which preserves the qualifier. This use is deemed safe. 237Fixing this violation would require to increase code complexity and lower readability." 238-config=MC3A2.R11.8,reports+={safe,"any_area(any_loc(any_exp(macro(^container_of$))))"} 239-doc_end 240 241-doc_begin="This construct is used to check if the type is scalar, and for this purpose the use of 0 as a null pointer constant is deliberate." 242-config=MC3A2.R11.9,reports+={deliberate, "any_area(any_loc(any_exp(macro(^__ACCESS_ONCE$))))" 243} 244-doc_end 245 246# 247# Series 13 248# 249 250-doc_begin="All developers and reviewers can be safely assumed to be well aware 251of the short-circuit evaluation strategy of such logical operators." 252-config=MC3A2.R13.5,reports+={disapplied,"any()"} 253-doc_end 254 255-doc_begin="Anything, no matter how complicated, inside the BUILD_ASSERT macro is subject to a compile-time evaluation without relevant side effects." 256-config=MC3A2.R13.6,reports+={safe,"any_area(any_loc(any_exp(macro(name(BUILD_ASSERT)))))"} 257-config=B.UNEVALEFF,reports+={safe,"any_area(any_loc(any_exp(macro(name(BUILD_ASSERT)))))"} 258-doc_end 259 260# 261# Series 14 262# 263 264-doc_begin="The severe restrictions imposed by this rule on the use of for 265statements are not balanced by the presumed facilitation of the peer review 266activity." 267-config=MC3A2.R14.2,reports+={disapplied,"any()"} 268-doc_end 269 270-doc_begin="The Zephyr team relies on the fact that invariant conditions of 'if' statements and conditional operators are deliberate" 271-config=MC3A2.R14.3,statements+={deliberate, "wrapped(any(),node(if_stmt||conditional_operator||binary_conditional_operator))" } 272-doc_end 273 274-doc_begin="Switches having a 'sizeof' operator as the condition are deliberate and have limited scope." 275-config=MC3A2.R14.3,statements+={deliberate, "wrapped(any(),node(switch_stmt)&&child(cond, operator(sizeof)))" } 276-doc_end 277 278-doc_begin="A controlling expression of 'if' and iteration statements having integer, character or pointer type has a semantics that is well-known to all Zephyr developers." 279-config=MC3A2.R14.4,etypes+={deliberate, "any()", "src_type(integer||character)||src_expr(type(desugar(pointer(any()))))"} 280-doc_end 281 282-doc_begin="The Zephyr team relies on the fact that the enum is_dying has the 283constant with assigned value 0 act as false and the other ones as true, 284therefore have the same behavior of a boolean" 285-config=MC3A2.R14.4,etypes+={deliberate, "stmt(child(cond,child(expr,ref(^<?domain>?::is_dying$))))","src_type(enum)"} 286-doc_end 287 288# 289# Series 16. 290# 291 292-doc_begin="Statements that change the control flow (i.e., break, continue, goto, return) and calls to functions that do not return the control back are \"allowed terminal statements\"." 293-stmt_selector+={r16_3_allowed_terminal, "node(break_stmt||continue_stmt||goto_stmt||return_stmt)||call(property(noreturn))"} 294-config=MC3A2.R16.3,terminals+={safe, "r16_3_allowed_terminal"} 295-doc_end 296 297-doc_begin="An if-else statement having both branches ending with an allowed terminal statement is itself an allowed terminal statement." 298-stmt_selector+={r16_3_if, "node(if_stmt)&&(child(then,r16_3_allowed_terminal)||child(then,any_stmt(stmt,-1,r16_3_allowed_terminal)))"} 299-stmt_selector+={r16_3_else, "node(if_stmt)&&(child(else,r16_3_allowed_terminal)||child(else,any_stmt(stmt,-1,r16_3_allowed_terminal)))"} 300-stmt_selector+={r16_3_if_else, "r16_3_if&&r16_3_else"} 301-config=MC3A2.R16.3,terminals+={safe, "r16_3_if_else"} 302-doc_end 303 304-doc_begin="An if-else statement having an always true condition and the true branch ending with an allowed terminal statement is itself an allowed terminal statement." 305-stmt_selector+={r16_3_if_true, "r16_3_if&&child(cond,definitely_in(1..))"} 306-config=MC3A2.R16.3,terminals+={safe, "r16_3_if_true"} 307-doc_end 308 309-doc_begin="A switch clause ending with a statement expression which, in turn, ends with an allowed terminal statement is safe." 310-config=MC3A2.R16.3,terminals+={safe, "node(stmt_expr)&&child(stmt,node(compound_stmt)&&any_stmt(stmt,-1,r16_3_allowed_terminal||r16_3_if_else||r16_3_if_true))"} 311-doc_end 312 313-doc_begin="A switch clause ending with a do-while-false the body of which, in turn, ends with an allowed terminal statement is safe. 314An exception to that is the macro ASSERT_UNREACHABLE() which is effective in debug build only: a switch clause ending with ASSERT_UNREACHABLE() is not considered safe." 315-config=MC3A2.R16.3,terminals+={safe, "!macro(name(ASSERT_UNREACHABLE))&&node(do_stmt)&&child(cond,definitely_in(0))&&child(body,any_stmt(stmt,-1,r16_3_allowed_terminal||r16_3_if_else||r16_3_if_true))"} 316-doc_end 317 318-doc_begin="Switch clauses ending with pseudo-keyword \"fallthrough\" are 319safe." 320-config=MC3A2.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(/fallthrough;/))))"} 321-doc_end 322 323-doc_begin="Switch clauses ending with failure method \"BUG()\" are safe." 324-config=MC3A2.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(/BUG\\(\\);/))))"} 325-doc_end 326 327-doc_begin="Switch clauses ending with an explicit comment indicating the fallthrough intention are safe." 328-config=MC3A2.R16.3,reports+={safe, "any_area(end_loc(any_exp(text(^(?s).*/\\* [fF]all ?through\\.? \\*/.*$,0..2))))"} 329-doc_end 330 331-doc_begin="Switch statements having a controlling expression of enum type deliberately do not have a default case: gcc -Wall enables -Wswitch which warns (and breaks the build as we use -Werror) if one of the enum labels is missing from the switch." 332-config=MC3A2.R16.4,reports+={deliberate,'any_area(kind(context)&&^.* has no `default.*$&&stmt(node(switch_stmt)&&child(cond,skip(__non_syntactic_paren_stmts,type(canonical(enum_underlying_type(any())))))))'} 333-doc_end 334 335-doc_begin="A switch statement with a single switch clause and no default label may be used in place of an equivalent if statement if it is considered to improve readability." 336-config=MC3A2.R16.4,switch_clauses+={deliberate,"switch(1)&&default(0)"} 337-doc_end 338 339-doc_begin="A switch statement with a single switch clause and no default label may be used in place of an equivalent if statement if it is considered to improve readability." 340-config=MC3A2.R16.6,switch_clauses+={deliberate, "default(0)"} 341-doc_end 342 343# 344# Series 17. 345# 346 347-doc_begin="printf()-like functions are allowed to use the variadic features provided by stdarg.h." 348-config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(^.*printk\\(.*\\)$)))"} 349-config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(^.*printf\\(.*\\)$)))"} 350-config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(name(panic)&&kind(function))))"} 351-config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(name(elf_call_log_callback)&&kind(function))))"} 352-config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(name(vprintk_common)&&kind(function))))"} 353-config=MC3A2.R17.1,macros+={hide , "^va_(arg|start|copy|end)$"} 354-doc_end 355 356-doc_begin="Not using the return value of a function does not endanger safety if it coincides with an actual argument." 357-config=MC3A2.R17.7,calls+={safe, "any()", "decl(name(__builtin_memcpy||__builtin_memmove||__builtin_memset||cpumask_check))"} 358-doc_end 359 360# 361# Series 18. 362# 363 364 365-doc_begin="The following macro performs a subtraction between pointers to obtain the mfn, but does not lead to undefined behaviour." 366-config=MC3A2.R18.2,reports+={safe, "any_area(any_loc(any_exp(macro(^page_to_mfn$))))"} 367-doc_end 368 369-doc_begin="Flexible array members are deliberately used and Zephyr developers are aware of the dangers related to them: 370unexpected result when the structure is given as argument to a sizeof() operator and the truncation in assignment between structures." 371-config=MC3A2.R18.7,reports+={deliberate, "any()"} 372-doc_end 373 374# 375# Series 20. 376# 377 378-doc_begin="Code violating Rule 20.7 is safe when macro parameters are used: (1) 379as function arguments; (2) as macro arguments; (3) as array indices; (4) as lhs 380in assignments; (5) as initializers, possibly designated, in initalizer lists; 381(6) as the constant expression in a switch clause label." 382-config=MC3A2.R20.7,expansion_context= 383{safe, "context(__call_expr_arg_contexts)"}, 384{safe, "left_right(^[(,\\[]$,^[),\\]]$)"}, 385{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(node(array_subscript_expr), subscript)))"}, 386{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(operator(assign), lhs)))"}, 387{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(node(init_list_expr||designated_init_expr), init)))"}, 388{safe, "context(skip_to(__expr_non_syntactic_contexts, stmt_child(node(case_stmt), lower||upper)))"} 389-doc_end 390 391-doc_begin="Violations involving the __config_enabled macros cannot be fixed without 392breaking the macro's logic; furthermore, the macro is only ever used in the context 393of the IS_ENABLED or STATIC_IF/STATIC_IF_NOT macros, so it always receives a literal 3940 or 1 as input, posing no risk to safety." 395-config=MC3A2.R20.7,reports+={safe, "any_area(any_loc(any_exp(macro(^___config_enabled$))))"} 396-doc_end 397 398-doc_begin="To avoid compromising readability, the macros alternative_(v)?call[0-9] are allowed 399not to parenthesize their arguments." 400-config=MC3A2.R20.7,reports+={safe, "any_area(any_loc(any_exp(macro(^alternative_(v)?call[0-9]$))))"} 401-doc_end 402 403-doc_begin="The argument 'x' of the count_args_ macro can't be parenthesized as 404the rule would require, without breaking the functionality of the macro. The uses 405of this macro do not lead to developer confusion, and can thus be deviated." 406-config=MC3A2.R20.7,reports+={safe, "any_area(any_loc(any_exp(macro(^count_args_$))))"} 407-doc_end 408 409-doc_begin="The argument \"fn\" in macros {COMPILE,RUNTIME}_CHECK is not parenthesized 410on purpose, to be able to test function-like macros. Given the specialized and limited 411use of this macro, it is deemed ok to deviate them." 412-config=MC3A2.R20.7,reports+={deliberate, "any_area(any_loc(any_exp(macro(^(COMPILE_CHECK|RUNTIME_CHECK)$))))"} 413-doc_end 414 415-doc_begin="Problems related to operator precedence can not occur if the expansion of the macro argument is surrounded by tokens '{', '}' and ';'." 416-config=MC3A2.R20.7,expansion_context+={safe, "left_right(^[\\{;]$,^[;\\}]$)"} 417-doc_end 418 419-doc_begin="Uses of variadic macros that have one of their arguments defined as 420a macro and used within the body for both ordinary parameter expansion and as an 421operand to the # or ## operators have a behavior that is well-understood and 422deliberate." 423-config=MC3A2.R20.12,macros+={deliberate, "variadic()"} 424-doc_end 425 426-doc_begin="Uses of a macro parameter for ordinary expansion and as an operand 427to the # or ## operators within the following macros are deliberate, to provide 428useful diagnostic messages to the user." 429-config=MC3A2.R20.12,macros+={deliberate, "name(__ASSERT||__ASSERT_NO_MSG||BUILD_ASSERT)"} 430-doc_end 431 432# 433# Series 21. 434# 435 436 437# 438# General 439# 440 441-doc_begin="do-while-[01] is a well recognized loop idiom by the Zephyr community." 442-loop_idioms={do_stmt, "literal(0)||literal(1)"} 443-doc_end 444-doc_begin="while-[01] is a well recognized loop idiom by the Zephyr community." 445-loop_idioms+={while_stmt, "literal(0)||literal(1)"} 446-doc_end 447 448# 449# Developer confusion 450# 451 452-doc="Selection for reports that are fully contained in adopted code." 453-report_selector+={adopted_report,"all_area(!kind(culprit||evidence)||all_loc(all_exp(adopted||pseudo)))"} 454 455-doc_begin="Adopted code is not meant to be read, reviewed or modified by human 456programmers:no developers' confusion is not possible. In addition, adopted code 457is assumed to work as is. Reports that are fully contained in adopted code are 458hidden/tagged with the 'adopted' tag." 459-service_selector={developer_confusion_guidelines,"^(MC3A2\\.R2\\.1|MC3A2\\.R2\\.2|MC3A2\\.R2\\.3|MC3A2\\.R2\\.4|MC3A2\\.R2\\.5|MC3A2\\.R2\\.6|MC3A2\\.R2\\.7|MC3A2\\.R4\\.1|MC3A2\\.R5\\.3|MC3A2\\.R5\\.6|MC3A2\\.R5\\.7|MC3A2\\.R5\\.8|MC3A2\\.R5\\.9|MC3A2\\.R7\\.1|MC3A2\\.R7\\.2|MC3A2\\.R7\\.3|MC3A2\\.R8\\.7|MC3A2\\.R8\\.8|MC3A2\\.R8\\.9|MC3A2\\.R8\\.11|MC3A2\\.R8\\.12|MC3A2\\.R8\\.13|MC3A2\\.R9\\.3|MC3A2\\.R9\\.4|MC3A2\\.R9\\.5|MC3A2\\.R10\\.2|MC3A2\\.R10\\.5|MC3A2\\.R10\\.6|MC3A2\\.R10\\.7|MC3A2\\.R10\\.8|MC3A2\\.R11\\.9|MC3A2\\.R12\\.1|MC3A2\\.R12\\.3|MC3A2\\.R12\\.4|MC3A2\\.R13\\.5|MC3A2\\.R14\\.1|MC3A2\\.R14\\.2|MC3A2\\.R14\\.3|MC3A2\\.R15\\.1|MC3A2\\.R15\\.2|MC3A2\\.R15\\.3|MC3A2\\.R15\\.4|MC3A2\\.R15\\.5|MC3A2\\.R15\\.6|MC3A2\\.R15\\.7|MC3A2\\.R16\\.1|MC3A2\\.R16\\.2|MC3A2\\.R16\\.3|MC3A2\\.R16\\.4|MC3A2\\.R16\\.5|MC3A2\\.R16\\.6|MC3A2\\.R16\\.7|MC3A2\\.R17\\.7|MC3A2\\.R17\\.8|MC3A2\\.R18\\.4|MC3A2\\.R18\\.5)$" 460} 461-config=developer_confusion_guidelines,reports+={relied,adopted_report} 462-doc_end 463