Skip to content

Commit

Permalink
Testsuite: Fix failures in g++.dg/analyzer/placement-new-size.C
Browse files Browse the repository at this point in the history
This testcase was failing on uses of int8_t, int64_t, etc without
including <stdint.h>.

gcc/testsuite/ChangeLog
	* g++.dg/analyzer/placement-new-size.C: Include <stdint.h>.  Also
	add missing newline to end of file.
  • Loading branch information
SandraLoosemore committed Dec 22, 2023
1 parent d26f589 commit 5cb79aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gcc/testsuite/g++.dg/analyzer/placement-new-size.C
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <new>
#include <stdlib.h>
#include <stdint.h>

extern int get_buf_size ();

Expand Down Expand Up @@ -34,4 +35,4 @@ void test_binop ()
int32_t *i = ::new (p + 1) int32_t; /* { dg-warning "heap-based buffer overflow" } */
*i = 42; /* { dg-warning "heap-based buffer overflow" } */
free (p);
}
}

0 comments on commit 5cb79aa

Please sign in to comment.