1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Fixed some errors & warnings found by clang

- pcretest.c could use macro with side effect
- maria_chk could access freed memory
- Initialized some variables that could be accessed uninitalized
- Fixed compiler warning in my_atomic-t.c
This commit is contained in:
Monty
2019-08-08 20:05:40 +03:00
parent 5fa2eb6f3d
commit dbac2039e8
5 changed files with 9 additions and 6 deletions

View File

@@ -90,10 +90,10 @@ pthread_handler_t test_atomic_cas(void *arg)
y= my_atomic_load32(&bad);
x= (x*m+0x87654321) & INT_MAX32;
do {
ok= my_atomic_cas32(&bad, &y, (uint32)y+x);
ok= my_atomic_cas32((int32*) &bad, &y, y+x);
} while (!ok) ;
do {
ok= my_atomic_cas32(&bad, &y, y-x);
ok= my_atomic_cas32((int32*) &bad, &y, y-x);
} while (!ok) ;
}
return 0;