Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cppcheck find bug #4

Open
RekGRpth opened this issue Nov 10, 2021 · 2 comments
Open

cppcheck find bug #4

RekGRpth opened this issue Nov 10, 2021 · 2 comments

Comments

@RekGRpth
Copy link

plpgsql_debugger.c:1119:7: style: Condition 'target' is always true [knownConditionTrueFalse]
  if( target )
      ^
plpgsql_debugger.c:1077:6: note: Assuming that condition '!target' is not redundant
 if (!target)
     ^
plpgsql_debugger.c:1119:7: note: Condition 'target' is always true
  if( target )
      ^
@RekGRpth
Copy link
Author

and

plpgsql_debugger.c:1270:11: style: Local variable 'i' shadows outer variable [shadowVariable]
   int    i;
          ^
plpgsql_debugger.c:1246:11: note: Shadowed declaration
  int     i;
          ^
plpgsql_debugger.c:1270:11: note: Shadow variable
   int    i;
          ^

that solve by

diff --git a/plpgsql_debugger.c b/plpgsql_debugger.c
index 6812592..872355c 100644
--- a/plpgsql_debugger.c
+++ b/plpgsql_debugger.c
@@ -1267,8 +1267,6 @@ is_datum_visible(PLpgSQL_datum *datum)
 
                if( strncmp( var->refname, "txt", 3 ) == 0 )
                {
-                       int        i;
-
                        /*
                         * Starts with 'txt' - see if the rest of the string is composed
                         * entirely of digits

@RekGRpth
Copy link
Author

and

pldbgapi.c:1195:5: style: Consecutive return, break, continue, goto or throw statements are unnecessary. [duplicateBreak]
    break;
    ^

tha solve by

diff --git a/pldbgapi.c b/pldbgapi.c
index 3a05260..7aff673 100644
--- a/pldbgapi.c
+++ b/pldbgapi.c
@@ -1192,7 +1192,6 @@ static void * readn( int serverHandle, void * dst, size_t len )
                        {
                                /* Timer expired */
                                return( NULL );
-                               break;
                        }
 
                        default:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant