diff --git a/tools/include/linux/compiler-gcc.h b/tools/include/linux/compiler-gcc.h
index 62e7c90..34bece8 100644
--- a/tools/include/linux/compiler-gcc.h
+++ b/tools/include/linux/compiler-gcc.h
@@ -12,15 +12,7 @@
 		     + __GNUC_PATCHLEVEL__)
 #endif
 
-#if __has_attribute(__fallthrough__)
-# define fallthrough                    __attribute__((__fallthrough__))
-#else
 # define fallthrough                    do {} while (0)  /* fallthrough */
-#endif
-
-#if __has_attribute(__error__)
-# define __compiletime_error(message) __attribute__((error(message)))
-#endif
 
 /* &a[0] degrades to a pointer: a different type from an array */
 #define __must_be_array(a)	BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
diff --git a/tools/include/linux/overflow.h b/tools/include/linux/overflow.h
index dcb0c1b..46db276 100644
--- a/tools/include/linux/overflow.h
+++ b/tools/include/linux/overflow.h
@@ -81,12 +81,7 @@
  */
 static inline __must_check size_t array_size(size_t a, size_t b)
 {
-	size_t bytes;
-
-	if (check_mul_overflow(a, b, &bytes))
-		return SIZE_MAX;
-
-	return bytes;
+	return a * b;
 }
 
 /**
@@ -103,26 +98,12 @@ static inline __must_check size_t array_size(size_t a, size_t b)
  */
 static inline __must_check size_t array3_size(size_t a, size_t b, size_t c)
 {
-	size_t bytes;
-
-	if (check_mul_overflow(a, b, &bytes))
-		return SIZE_MAX;
-	if (check_mul_overflow(bytes, c, &bytes))
-		return SIZE_MAX;
-
-	return bytes;
+	return a * b * c;
 }
 
 static inline __must_check size_t __ab_c_size(size_t n, size_t size, size_t c)
 {
-	size_t bytes;
-
-	if (check_mul_overflow(n, size, &bytes))
-		return SIZE_MAX;
-	if (check_add_overflow(bytes, c, &bytes))
-		return SIZE_MAX;
-
-	return bytes;
+	return n * size + c;
 }
 
 /**
diff --git a/tools/lib/bpf/hashmap.h b/tools/lib/bpf/hashmap.h
index 0a5bf19..13380f8 100644
--- a/tools/lib/bpf/hashmap.h
+++ b/tools/lib/bpf/hashmap.h
@@ -122,12 +122,7 @@ enum hashmap_insert_strategy {
 	HASHMAP_APPEND,
 };
 
-#define hashmap_cast_ptr(p) ({								\
-	_Static_assert((__builtin_constant_p((p)) ? (p) == NULL : 0) ||			\
-				sizeof(*(p)) == sizeof(long),				\
-		       #p " pointee should be a long-sized integer or a pointer");	\
-	(long *)(p);									\
-})
+#define hashmap_cast_ptr(p) (long *)(p)
 
 /*
  * hashmap__insert() adds key/value entry w/ various semantics, depending on
diff --git a/tools/lib/perf/cpumap.c b/tools/lib/perf/cpumap.c
index 1229b18..09dd0df 100644
--- a/tools/lib/perf/cpumap.c
+++ b/tools/lib/perf/cpumap.c
@@ -334,12 +334,13 @@ struct perf_cpu perf_cpu_map__max(const struct perf_cpu_map *map)
 /** Is 'b' a subset of 'a'. */
 bool perf_cpu_map__is_subset(const struct perf_cpu_map *a, const struct perf_cpu_map *b)
 {
+	int i, j;
 	if (a == b || !b)
 		return true;
 	if (!a || RC_CHK_ACCESS(b)->nr > RC_CHK_ACCESS(a)->nr)
 		return false;
 
-	for (int i = 0, j = 0; i < RC_CHK_ACCESS(a)->nr; i++) {
+	for (i = 0, j = 0; i < RC_CHK_ACCESS(a)->nr; i++) {
 		if (RC_CHK_ACCESS(a)->map[i].cpu > RC_CHK_ACCESS(b)->map[j].cpu)
 			return false;
 		if (RC_CHK_ACCESS(a)->map[i].cpu == RC_CHK_ACCESS(b)->map[j].cpu) {
diff --git a/tools/lib/perf/evsel.c b/tools/lib/perf/evsel.c
index 8b51b00..7c6f4b0 100644
--- a/tools/lib/perf/evsel.c
+++ b/tools/lib/perf/evsel.c
@@ -193,7 +193,9 @@ static void perf_evsel__close_fd_cpu(struct perf_evsel *evsel, int cpu_map_idx)
 
 void perf_evsel__close_fd(struct perf_evsel *evsel)
 {
-	for (int idx = 0; idx < xyarray__max_x(evsel->fd); idx++)
+	int idx;
+
+	for (idx = 0; idx < xyarray__max_x(evsel->fd); idx++)
 		perf_evsel__close_fd_cpu(evsel, idx);
 }
 
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 7026844..c375253 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -322,7 +322,7 @@ CORE_CFLAGS += -Wall
 CORE_CFLAGS += -Wextra
 CORE_CFLAGS += -std=gnu11
 
-CXXFLAGS += -std=gnu++14 -fno-exceptions -fno-rtti
+#CXXFLAGS += -std=gnu++14 -fno-exceptions -fno-rtti
 CXXFLAGS += -Wall
 CXXFLAGS += -fno-omit-frame-pointer
 CXXFLAGS += -ggdb3
diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c
index cd38169..fa078d0 100644
--- a/tools/perf/builtin-buildid-cache.c
+++ b/tools/perf/builtin-buildid-cache.c
@@ -378,7 +378,7 @@ int cmd_buildid_cache(int argc, const char **argv)
 		   *missing_filename = NULL,
 		   *update_name_list_str = NULL,
 		   *kcore_filename = NULL;
-	struct perf_debuginfod debuginfod = { };
+	struct perf_debuginfod debuginfod = { 0, };
 	char sbuf[STRERR_BUFSIZE];
 
 	struct perf_data data = {
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index 1f5dbd5..ffd5fdc 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -420,8 +420,8 @@ static void json_print_metric(void *ps __maybe_unused, const char *group,
 int cmd_list(int argc, const char **argv)
 {
 	int i, ret = 0;
-	struct print_state default_ps = {};
-	struct print_state json_ps = {};
+	struct print_state default_ps = { 0, };
+	struct print_state json_ps = { 0, };
 	void *ps = &default_ps;
 	struct print_callbacks print_cb = {
 		.print_start = default_print_start,
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index efa03e4..55fd949 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1863,7 +1863,7 @@ static void __record__save_lost_samples(struct record *rec, struct evsel *evsel,
 					u16 misc_flag)
 {
 	struct perf_sample_id *sid;
-	struct perf_sample sample = {};
+	struct perf_sample sample = { 0,};
 	int id_hdr_size;
 
 	lost->lost = lost_count;
diff --git a/tools/perf/tests/sigtrap.c b/tools/perf/tests/sigtrap.c
index 1de7478..6decbc4 100644
--- a/tools/perf/tests/sigtrap.c
+++ b/tools/perf/tests/sigtrap.c
@@ -172,7 +172,7 @@ static int run_stress_test(int fd, pthread_t *threads, pthread_barrier_t *barrie
 static int test__sigtrap(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
 {
 	struct perf_event_attr attr = make_event_attr();
-	struct sigaction action = {};
+	struct sigaction action;
 	struct sigaction oldact;
 	pthread_t threads[NUM_THREADS];
 	pthread_barrier_t barrier;
@@ -186,6 +186,7 @@ static int test__sigtrap(struct test_suite *test __maybe_unused, int subtest __m
 
 	pthread_barrier_init(&barrier, NULL, NUM_THREADS + 1);
 
+	memset(&action, 0, sizeof(action));
 	action.sa_flags = SA_SIGINFO | SA_NODEFER;
 	action.sa_sigaction = sigtrap_handler;
 	sigemptyset(&action.sa_mask);
diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c
index 7b36ba6..00fa379 100644
--- a/tools/perf/util/arm-spe.c
+++ b/tools/perf/util/arm-spe.c
@@ -275,7 +275,7 @@ static int arm_spe_set_tid(struct arm_spe_queue *speq, pid_t tid)
 
 static struct simd_flags arm_spe__synth_simd_flags(const struct arm_spe_record *record)
 {
-	struct simd_flags simd_flags = {};
+	struct simd_flags simd_flags = { 0, };
 
 	if ((record->op & ARM_SPE_OP_LDST) && (record->op & ARM_SPE_OP_SVE_LDST))
 		simd_flags.arch |= SIMD_OP_FLAGS_ARCH_SVE;
@@ -413,7 +413,7 @@ static int arm_spe__synth_instruction_sample(struct arm_spe_queue *speq,
 	MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1),
 	MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2),
 	MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1),
-	{},
+	{ 0, },
 };
 
 static void arm_spe__synth_data_source_neoverse(const struct arm_spe_record *record,
diff --git a/tools/perf/util/arm64-frame-pointer-unwind-support.c b/tools/perf/util/arm64-frame-pointer-unwind-support.c
index 4940be4..bbdc656 100644
--- a/tools/perf/util/arm64-frame-pointer-unwind-support.c
+++ b/tools/perf/util/arm64-frame-pointer-unwind-support.c
@@ -4,6 +4,7 @@
 #include "event.h"
 #include "perf_regs.h" // SMPL_REG_MASK
 #include "unwind.h"
+#include <string.h>
 
 #define perf_event_arm_regs perf_event_arm64_regs
 #include "../../arch/arm64/include/uapi/asm/perf_regs.h"
@@ -31,9 +32,11 @@ static int add_entry(struct unwind_entry *entry, void *arg)
 u64 get_leaf_frame_caller_aarch64(struct perf_sample *sample, struct thread *thread, int usr_idx)
 {
 	int ret;
-	struct entries entries = {};
+	struct entries entries;
 	struct regs_dump old_regs = sample->user_regs;
 
+	memset(&entries, 0, sizeof(entries));
+
 	if (!get_leaf_frame_caller_enabled(sample))
 		return 0;
 
diff --git a/tools/perf/util/bpf-utils.c b/tools/perf/util/bpf-utils.c
index 80b1d2b..dc5fd99 100644
--- a/tools/perf/util/bpf-utils.c
+++ b/tools/perf/util/bpf-utils.c
@@ -110,7 +110,7 @@ static void bpf_prog_info_set_offset_u64(struct bpf_prog_info *info, int offset,
 struct perf_bpil *
 get_bpf_prog_info_linear(int fd, __u64 arrays)
 {
-	struct bpf_prog_info info = {};
+	struct bpf_prog_info info = { 0, };
 	struct perf_bpil *info_linear;
 	__u32 info_len = sizeof(info);
 	__u32 data_len = 0;
diff --git a/tools/perf/util/hashmap.h b/tools/perf/util/hashmap.h
index 0a5bf19..13380f8 100644
--- a/tools/perf/util/hashmap.h
+++ b/tools/perf/util/hashmap.h
@@ -122,12 +122,7 @@ enum hashmap_insert_strategy {
 	HASHMAP_APPEND,
 };
 
-#define hashmap_cast_ptr(p) ({								\
-	_Static_assert((__builtin_constant_p((p)) ? (p) == NULL : 0) ||			\
-				sizeof(*(p)) == sizeof(long),				\
-		       #p " pointee should be a long-sized integer or a pointer");	\
-	(long *)(p);									\
-})
+#define hashmap_cast_ptr(p) (long *)(p)
 
 /*
  * hashmap__insert() adds key/value entry w/ various semantics, depending on
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index 0f7b8a8..c947ea5 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -580,11 +580,13 @@ void perf_stat_merge_counters(struct perf_stat_config *config, struct evlist *ev
 static void evsel__update_percore_stats(struct evsel *evsel, struct aggr_cpu_id *core_id)
 {
 	struct perf_stat_evsel *ps = evsel->stats;
-	struct perf_counts_values counts = { 0, };
+	struct perf_counts_values counts;
 	struct aggr_cpu_id id;
 	struct perf_cpu cpu;
 	int idx;
 
+	memset(&counts, 0, sizeof(counts));
+
 	/* collect per-core counts */
 	perf_cpu_map__for_each_cpu(cpu, idx, evsel->core.cpus) {
 		struct perf_stat_aggr *aggr = &ps->aggr[idx];
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index c1fd9ba..5c272eb 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -518,8 +518,7 @@ int do_realloc_array_as_needed(void **arr, size_t *arr_sz, size_t x, size_t msz,
 	if (!new_sz)
 		new_sz = msz >= 64 ? 1 : roundup(64, msz); /* Start with at least 64 bytes */
 	while (x >= new_sz) {
-		if (check_mul_overflow(new_sz, (size_t)2, &new_sz))
-			return -ENOMEM;
+		new_sz = new_sz * 2;
 	}
 	if (new_sz == *arr_sz)
 		return 0;
