No handlers will be unsubscribed, as a separate delegate instance is created for each anonymous function declaration. The result will always be zero. Probably meant: 'new type[n]'. In this case, the return value of the called function is undefined. MISRA. Consider inspecting the condition. Decreased performance. The value of an expression is a potentially destroyed Unity object or null. ConcurrentModificationException may occur. V1091. The 'static' storage class specifier should be used in all declarations of object and functions that have internal linkage. Suspicious access to element by a constant index inside a loop. V701. Functions should be declared in prototype form with named parameters. N operand of '? Thanks for contributing an answer to Stack Overflow! Classes should not be compared by their name. Try to avoid many return statements in your code. V2585. A pointer/reference parameter in a function should be declared as pointer/reference to const if the corresponding object was not modified. V2503. EXP12-C. Do not ignore values returned by functions An exception handling block does not contain any code. Consider replacing 'const T' with 'const .. &T' / 'const .. *T'. Using this sequence lead to undefined behavior. Signed value is converted to an unsigned one with subsequent expansion to a larger type in ternary operator. Single-bit bit fields should not be declared as signed type. V532. V3100. The 'if (A) {} else if (A) {}' pattern was detected. V672. V797. However, C doesn't require the parentheses. Member 'x' should point to string terminated by two 0 characters. Generating points along line with specifying the origin of point generation in QGIS. CS50 Stack Exchange is a question and answer site for students of Harvard University's CS50. MISRA. Consider allocating it on the stack instead. It makes code less human error prone. Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. In this case, we can call either a non-value returning function, or we can call a value-returning function and just ignore the return value. So, the compiler generates an error. Different containers are used to set up initial and final values of iterator. At the end of printHi, control returns to main and the program proceeds. The object was used after it was verified against null. MISRA. V2570. This leads to undefined behavior. Consider inspecting the 'T foo = foo = x;' expression. OWASP. There is nothing we can do in this situation - there are no default values to return in case of exceptions. V738. Has the cause of a rocket failure ever been mis-identified, such that another launch failed due to the same problem? Check lines: N1, N2. V3104. V126. V551. The '!=' operator should probably be used here. Numeric Truncation Error. V811. V509. V5005. It's probably an error or un-optimized code. V2512. V3180. AUTOSAR. V1044. V639. An unconditional 'break/continue/return/goto' within a loop. MISRA. The opposite operator must also be defined. Possibility of decreased performance. If no value is provided, the compiler will produce a syntax error. The sizeof() operator is multiplied by sizeof(). The 'else' keyword may be missing. V677. Variable is not passed into foreach loop by reference, but its value is changed inside of the loop. OWASP. Use memsize type instead. V2615. It is possible that other value should be present instead of '0'. Consider inspecting usage of 'Y' counter. MISRA. Every 'switch' statement should contain non-empty switch-clauses. You are assuming that loop will always run, but, what if an empty string ends up getting submitted? V2563. V726. When a return statement contains an expression in functions that have a void return type, the compiler generates a warning, and the expression isn't evaluated. V2019. OWASP. If a return type isn't specified, the C compiler assumes a default return type of int. Consider inspecting the loop expression. The 'Foo' function should not be called from 'DllMain' function. V3175. The compiler has been asked to treat warnings as errors. The '? Class that contains pointers, constructor and destructor is copied by the automatically generated operator= or copy constructor. It's possible that ',' should be replaced by ';'. V737. V3094. Consider casting operands, not the result. Non-void function is no values returned causes crash #5867 The expression of 'foo(foo(x))' pattern is excessive or contains an error. V6009. These conditions may be true or false. V3081. V104. Possible log injection. The 'static' storage class specifier should be used in all declarations of functions that have internal linkage. A value of variable is not modified. V630. V6069. Then main returns a value of 0 (typically used to report success) to end the program. Decreased performance. Bit fields should only be declared with explicitly signed or unsigned integer type. V3121. The 'SysFreeString' function should be called only for objects of the 'BSTR' type. Property accessors use different backing fields. V1076. V6041. A function that does not return a value is called a non-value returning function (or a void function). If you have parameters instead of "void" in your function's parentheses you have to return something. V580. C-style explicit type casting is utilized. Consider inspecting the expression. V3019. The best answers are voted up and rise to the top, Not the answer you're looking for? Consider inspecting the expression. Probably meant: '\xNN'. Consider inspecting the expression. Youll need to comment out this line of code in order to make your code compile. It is possible that an error is present. The return value of non-void function should be used. Dereferencing the result of 'as' operator can lead to NullReferenceException. Since the second call to std::cout does not provide a value to be printed, this causes an error. AUTOSAR. The 'A' class contains 'Dispose' method. It is possible that a line was commented out improperly, thus altering the program's operation logic. This may lead to undefined behavior. Consequently, putting an empty return statement at the end of a void function is redundant: Do not put a return statement at the end of a non-value returning function. V1070. The 'then' statement is equivalent to the 'else' statement. Virtual table pointer will be damaged. It's possible that the line was commented out improperly, thus altering the program's operation logics. MISRA. Since the function doesnt return a value, this is fine. If a function returns no meaningful value, it should be declared with return type void. The expression is incorrect or it can be simplified. V834. Analysis aborted by timeout. Identifiers that start with '__' or '_[A-Z]' are reserved. rev2023.4.21.43403. V2599. Suspicious explicit conversion from 'float *' type to 'double *' type. Thanks for contributing an answer to Stack Overflow! Incorrect shifting expression. Suspicious division. Does a password policy with a restriction of repeated characters increase security? V2613. V3085. Probably meant: *ptr != zero. The argument of the method is not expected to be null. Use of potentially tainted data in configuration may lead to security issues. The result of '&' operator is '0' because one of the operands is '0'. V3072. Connect and share knowledge within a single location that is structured and easy to search. The 'X' counter is not used inside a nested loop. There is a probability of logical error presence. EOF should not be compared with a value of the 'char' type. OWASP. Function execution could be deferred. WPF: readonly field of 'DependencyProperty' type is not initialized. Calling method or accessing property of potentially disposed object may result in exception. Unsafe double-checked locking. V3184. V207. Unexpected uint64 behaviour 0xFFFF'FFFF'FFFF'FFFF - 1 = 0? Email? You signed in with another tab or window. V577. The 'strcmp' function returns 0 if corresponding strings are equal. V632. It is probably unused, uninitialized, or already locked. The 'throw' keyword could be missing. Inconsistent synchronization of a field. As report_square takes no parameters and returns void, we don't assign its result to a variable. V3071. The object could have been garbage collected before the 'Target' property was accessed. V3147. V2016. This is the same thing that happens at the end of the function anyway. MISRA. The object of non-passive (non-PDS) type cannot be used with the function. We and our partners use cookies to Store and/or access information on a device. Consider adding the 'cin.fail()' function call to the conditional expression. A smart pointer may not destroy an object correctly. V810. It may happen that flow is never reaching that part of the code but it is important to write for the compiler. The 'foo' word is suspicious. C++ code showing Line 25: Char 5: error: non-void function does not