Skip to content

Commit eea522b

Browse files
jvoisinthestinger
authored andcommitted
Silence warnings in the testsuite
1 parent 92619f1 commit eea522b

11 files changed

+22
-0
lines changed

test/impossibly_large_malloc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include "test_util.h"
44

5+
#pragma GCC diagnostic ignored "-Walloc-size-larger-than="
6+
57
OPTNONE int main(void) {
68
char *p = malloc(-8);
79
return !(p == NULL);

test/invalid_free_protected.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include "test_util.h"
66

7+
#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
8+
79
OPTNONE int main(void) {
810
free(malloc(16));
911
char *p = mmap(NULL, 4096 * 16, PROT_NONE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);

test/invalid_free_small_region.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include "test_util.h"
44

5+
#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
6+
57
OPTNONE int main(void) {
68
char *p = malloc(16);
79
if (!p) {

test/invalid_free_small_region_far.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include "test_util.h"
44

5+
#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
6+
57
OPTNONE int main(void) {
68
char *p = malloc(16);
79
if (!p) {

test/invalid_free_unprotected.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include "test_util.h"
66

7+
#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
8+
79
OPTNONE int main(void) {
810
free(malloc(16));
911
char *p = mmap(NULL, 4096 * 16, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);

test/mallinfo.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#include "test_util.h"
99

10+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
11+
1012
static void print_mallinfo(void) {
1113
#if defined(__GLIBC__) || defined(__ANDROID__)
1214
struct mallinfo info = mallinfo();

test/mallinfo2.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#include "test_util.h"
99

10+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
11+
1012
static void print_mallinfo2(void) {
1113
#if defined(__GLIBC__)
1214
struct mallinfo2 info = mallinfo2();

test/unaligned_free_large.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include "test_util.h"
44

5+
#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
6+
57
OPTNONE int main(void) {
68
char *p = malloc(256 * 1024);
79
if (!p) {

test/unaligned_free_small.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include "test_util.h"
44

5+
#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
6+
57
OPTNONE int main(void) {
68
char *p = malloc(16);
79
if (!p) {

test/uninitialized_free.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include "test_util.h"
44

5+
#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
6+
57
OPTNONE int main(void) {
68
free((void *)1);
79
return 0;

0 commit comments

Comments
 (0)