[MDEV-27518] Run cppcheck on Spider and fix errors Created: 2022-01-16  Updated: 2023-11-28

Status: Stalled
Project: MariaDB Server
Component/s: Storage Engine - Spider
Fix Version/s: 10.11

Type: Task Priority: Major
Reporter: Nayuta Yanagisawa (Inactive) Assignee: Yuchen Pei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Run cppcheck on Spider and fix errors. This should be done the clean up of #ifdef (MDEV-26178).



 Comments   
Comment by Daniel Black [ 2023-01-13 ]

I ran on 10.11 , cppcheck-2.9 and found no errors in spider and only a few in mysys that it depends on.

$ cmake -DCMAKE_CXX_CPPCHECK='cppcheck;-DO_NONBLOCK;-DINT_MAX=0x7FFFFFFF'  -DCMAKE_C_CPPCHECK='cppcheck;-DO_NONBLOCK;-DINT_MAX=0x7FFFFFFF' . 

Comment by Yuchen Pei [ 2023-01-17 ]

Running cppcheck . (version 2.3) under /storage/spider (11.0, 314e50b464e) and it prints and hangs at

...
3/16 files checked 24% done
Checking spd_db_conn.cc ...
spd_db_conn.cc:9031:5: error: Address of local auto-variable assigned to a function parameter. [autoVariables]
    conn->need_mon = &need_mon;
    ^
spd_db_conn.cc:9106:7: error: Address of local auto-variable assigned to a function parameter. [autoVariables]
      conn->need_mon = &need_mon;
      ^
spd_db_conn.cc:9369:3: error: Address of local auto-variable assigned to a function parameter. [autoVariables]
  conn->need_mon = &need_mon;
  ^
  C-c C-c

Generated at Thu Feb 08 09:53:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.