MISRA. V3096. Already on GitHub? V302. If a function returns no meaningful value, it should be declared with return type void. Bool type value is compared with value of N. Consider inspecting the expression. Perhaps the correct expression is strlen(expr) + 1. This way, you won't miss messages from our team in the future. V699. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. Use 'double.IsNaN()' method instead. V3542. V3140. Call of the 'Foo' function will lead to buffer overflow. Absolute values of both operands are equal. V791. V6015. Since the second call to std::cout does not provide a value to be printed, this causes an error. V3537. V1002. Features from should not be used. Pointer to local variable 'X' is stored outside the scope of this variable. The function with the 'abort/exit/getenv/system' name should not be used. MISRA. Probably it is a mistake. MISRA. The escape sequence ends with a letter and the next character is also a letter. Analysis aborted by timeout. Function receives suspicious argument. V799. Is the code I've written here adequate to do that? V663. It means that there is no default return value for your function outside of the for loop. V661. MISRA. V6033. Possible excessive expression or typo. V3069. The 'x' variable is assigned values twice successively. Priority of '+' operation is higher than priority of '<<' operation. V501. Decreased performance. Suspicious invocation of Thread.run(). Calling a virtual (overridden) event may lead to unpredictable behavior. The variable of char type is compared with pointer to string. Decreased performance. It is inefficient to identify an empty string by using 'strlen(str) > 0' construct. Its representation is implementation-defined. Probably meant: *ptr != zero. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. V009. Suspicious return of an always empty collection. It's odd that this method always returns one and the same value of NN. AUTOSAR. V2565. I compiled a small program containing the following function definition. There are two 'if' statements with identical conditional expressions. Annotation that does not have 'RUNTIME' retention policy will not be accessible through Reflection API. The 'a' variable was used after it was assigned through null-conditional operator. The best answers are voted up and rise to the top, Not the answer you're looking for? V3040. Consider inspecting the expression. How do I count the number of sentences in C using ". Consider inspecting 'X'. It is possible that different variables are used inside initializer and iterator. Function with a non-void return type should return a value from all exit paths. Suspicious return of a local reference variable which always equals null. V3177. It is possible that a typo is present inside the expression. Non-void function must return value. Functions should be declared in prototype form with named parameters. V6063. The object of non-passive (non-PDS) type cannot be used with the function. V804. The expression of strlen(MyStr.c_str()) kind can be rewritten as MyStr.length(). The reference was used before it was verified against null. V2610. V822. It is possible that a typo is present inside the string literal. All integer constants of unsigned type should have 'U' suffix. If total energies differ across different software, how do I decide which software to use? A function with a non-void return type must return an answer no matter what its parameters are. The expression, if present, is evaluated and then converted to the type returned by the function. V6041. V683. MISRA. . I can give he a test with 2.0.3-RC1 and lease you perceive The return keyword is used during the end of to function to get the value back. V3086. A boy can regenerate, so demons eat him for years. This may be a potential error. Consider inspecting the expression. Do not warn if a caller of a function marked with attribute warn_unused_result (see Variable Attributes) does not use its return value. OWASP. V011. However, C doesn't require the parentheses. V805. int sometimes ( int x) { if (x > 0) { return 2*x; } } The address of an object with local scope should not be passed out of its scope. The value range of the variable: [A, B]. V1071. Pointer was used before its check for nullptr. MISRA. A function should not call itself either directly or indirectly. Consider checking the N format items of the 'Foo' function. There should be no occurrence of undefined or critical unspecified behaviour. V703. Probably the '-=' should be used here. 565), Improving the copy in the close modal and post notices - 2023 edition, New blog post from our CEO Prashanth: Community is the future of AI. The standard signal handling functions should not be used. The 'continue' operator will terminate 'do { } while (false)' loop because the condition is always false. The value of a composite expression should not be assigned to an object with wider essential type. V2532. the first printHi() in the above example), were calling a function for its behavior, not its return value. Expression can be simplified: check similar operands. V2596. Conditional escape sequence in literal. i'm not sure if this is intentional behavior. The result of an assignment expression should not be used. The 'operator &&', 'operator ||', 'operator ,' and the unary 'operator &' should not be overloaded. The main function calls two functions: report_square and report_ratio. The field (property) is used before it is initialized in constructor. WPF: writing and reading are performed on a different Dependency Properties. V544. Is a return statement mandatory for C++ functions that do not return void? V6017. Consider inspecting the expression. Parts of an SQL query are not delimited by any separators or whitespaces. OWASP. Possibly an equality comparison was intended. Unsafe usage of the 'bool' and integer types together in the operation '&='. OWASP. V505. V6038. The behavior is undefined for arithmetic or comparisons with pointers that do not point to members of the same array. Lifetime of the heap-allocated variable is limited to the current function's scope. V821. It is suspicious that the assignment operator takes an object by a non-constant reference and returns this object. Suspicious subexpression in a sequence of similar comparisons. New variable with default value is created instead of 'std::unique_lock' that locks on the mutex. warning: non-void function does not return a value - YouTube Decreased performance. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. NullReferenceException is possible. AUTOSAR. A thread can wait indefinitely or experience a spurious wake-up. V128. V3547. V749. V798. Consider refactoring the code. V717. V3059. AUTOSAR. OWASP. It is possible that an incorrect variable is compared with null after type conversion using 'dynamic_cast'. Recursive function call during the static/thread_local variable initialization might occur. V3169. Potentially tainted data is used in the URL. V631. Derived class object was copied to the base class object. V694. Your message has been sent. The 'throw' keyword could be missing. Check lines: N1, N2. V3135. MISRA. Possible overflow. Use of potentially tainted data in configuration may lead to security issues. V3160. Incorrect format. V535. MISRA. V1054. MISRA. MISRA. The '+' operation is executed. Conversions between pointers to objects and integer types should not be performed. MISRA. Operand of sizeof() operator should not have other side effects. Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. V2570. The report_square function has a void return type, so it doesn't have an expression in its return statement. A terminal null is present inside a string. A function that does not return a value is called a non-value returning function (or a void function). Variable 'foo' was assigned the same value. V503. Modification of variable is unsequenced relative to another operation on the same variable. The 'x' variable is assigned to itself. Giving short names to global variables is considered to be bad practice. MISRA. cs50 - C error: non-void function does not return a value in all This case may be unreachable. MISRA. How to Make a Black glass pass light through it? How to Make a Black glass pass light through it? V3005. operator should have 'bool' type. Possible use of left shift operator instead of comparison operator. We and our partners use data for Personalised ads and content, ad and content measurement, audience insights and product development. V636. Why don't we use the 7805 for car phone chargers? It is possible that a line was commented out improperly, thus altering the program's operation logic. Size of the 'time_t' type is not 64 bits. It is odd that the body of 'Foo_1' function is fully equivalent to the body of 'Foo_2' function. V708. Member operator[] of object 'foo' is declared with 32-bit type argument, but is called with memsize type argument. V2516. V2518. V3512. Check the following code block after the 'if' statement. Probably meant: (T1)((T2)a + b). V650. V204. It is possible literal was intended to belong to '??' V2524. V3076. Unexpected uint64 behaviour 0xFFFF'FFFF'FFFF'FFFF - 1 = 0?