summaryrefslogtreecommitdiff
path: root/perf
diff options
context:
space:
mode:
authornjn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9>2009-02-23 06:44:51 +0000
committernjn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9>2009-02-23 06:44:51 +0000
commitefc13c21199dbb35ad07a5e00d538aa884863c01 (patch)
tree5062e41acb0f06ff69bef9f89feb75896a758ad5 /perf
parent2a5a76b43b99c5a62c16140505a7f9fcbc0a5fb4 (diff)
Get rid of all "make check" compile warnings, except for the ones from
fxtract.c. Also, gets rid of some of the warnings that -Wextra finds in Massif. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9237 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'perf')
-rw-r--r--perf/Makefile.am6
-rw-r--r--perf/tinycc.c26
2 files changed, 20 insertions, 12 deletions
diff --git a/perf/Makefile.am b/perf/Makefile.am
index b9e2e816..9ea7d942 100644
--- a/perf/Makefile.am
+++ b/perf/Makefile.am
@@ -23,7 +23,9 @@ AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g -O $(AM_FLAG_M3264_PRI)
AM_CXXFLAGS = $(AM_CFLAGS)
# Extra stuff
-fbench_CFLAGS = $(AM_FLAG_M3264_PRI) -g -O2
+bz2_CFLAGS = $(AM_CFLAGS) -Wno-inline
+
+fbench_CFLAGS = $(AM_CFLAGS) -O2
ffbench_LDADD = -lm
-tinycc_CFLAGS = $(AM_CFLAGS) -Wno-shadow
+tinycc_CFLAGS = $(AM_CFLAGS) -Wno-shadow -Wno-inline
diff --git a/perf/tinycc.c b/perf/tinycc.c
index c445b971..5bef0664 100644
--- a/perf/tinycc.c
+++ b/perf/tinycc.c
@@ -59,6 +59,12 @@
//#endif /* !CONFIG_TCCBOOT */
+// Dummy variables used to avoid warnings like these:
+// warning: ignoring return value of ‘fwrite’, declared with attribute
+// warn_unused_result
+char* dummy_char_star;
+size_t dummy_size_t;
+
// njn: inlined elf.h
//#include "elf.h"
//---------------------------------------------------------------------------
@@ -14839,7 +14845,7 @@ static int tcc_compile(TCCState *s1)
section_sym = put_elf_sym(symtab_section, 0, 0,
ELF32_ST_INFO(STB_LOCAL, STT_SECTION), 0,
text_section->sh_num, NULL);
- getcwd(buf, sizeof(buf));
+ dummy_char_star = getcwd(buf, sizeof(buf));
pstrcat(buf, sizeof(buf), "/");
put_stabs_r(buf, N_SO, 0, 0,
text_section->data_offset, text_section, section_sym);
@@ -19193,7 +19199,7 @@ static void tcc_output_binary(TCCState *s1, FILE *f,
offset++;
}
size = s->sh_size;
- fwrite(s->data, 1, size, f);
+ dummy_size_t = fwrite(s->data, 1, size, f);
offset += size;
}
}
@@ -19776,8 +19782,8 @@ int tcc_output_file(TCCState *s1, const char *filename)
ehdr.e_shnum = shnum;
ehdr.e_shstrndx = shnum - 1;
- fwrite(&ehdr, 1, sizeof(Elf32_Ehdr), f);
- fwrite(phdr, 1, phnum * sizeof(Elf32_Phdr), f);
+ dummy_size_t = fwrite(&ehdr, 1, sizeof(Elf32_Ehdr), f);
+ dummy_size_t = fwrite(phdr, 1, phnum * sizeof(Elf32_Phdr), f);
offset = sizeof(Elf32_Ehdr) + phnum * sizeof(Elf32_Phdr);
for(i=1;i<s1->nb_sections;i++) {
@@ -19788,7 +19794,7 @@ int tcc_output_file(TCCState *s1, const char *filename)
offset++;
}
size = s->sh_size;
- fwrite(s->data, 1, size, f);
+ dummy_size_t = fwrite(s->data, 1, size, f);
offset += size;
}
}
@@ -19816,7 +19822,7 @@ int tcc_output_file(TCCState *s1, const char *filename)
sh->sh_offset = s->sh_offset;
sh->sh_size = s->sh_size;
}
- fwrite(sh, 1, sizeof(Elf32_Shdr), f);
+ dummy_size_t = fwrite(sh, 1, sizeof(Elf32_Shdr), f);
}
} else {
tcc_output_binary(s1, f, section_order);
@@ -19838,7 +19844,7 @@ static void *load_data(int fd, unsigned long file_offset, unsigned long size)
data = tcc_malloc(size);
lseek(fd, file_offset, SEEK_SET);
- read(fd, data, size);
+ dummy_size_t = read(fd, data, size);
return data;
}
@@ -19975,7 +19981,7 @@ static int tcc_load_object_file(TCCState *s1,
unsigned char *ptr;
lseek(fd, file_offset + sh->sh_offset, SEEK_SET);
ptr = section_ptr_add(s, size);
- read(fd, ptr, size);
+ dummy_size_t = read(fd, ptr, size);
} else {
s->data_offset += size;
}
@@ -20157,7 +20163,7 @@ static int tcc_load_archive(TCCState *s1, int fd)
unsigned long file_offset;
/* skip magic which was already checked */
- read(fd, magic, sizeof(magic));
+ dummy_size_t = read(fd, magic, sizeof(magic));
for(;;) {
len = read(fd, &hdr, sizeof(hdr));
@@ -20212,7 +20218,7 @@ static int tcc_load_dll(TCCState *s1, int fd, const char *filename, int level)
const char *name, *soname, *p;
DLLReference *dllref;
- read(fd, &ehdr, sizeof(ehdr));
+ dummy_size_t = read(fd, &ehdr, sizeof(ehdr));
/* test CPU specific stuff */
if (ehdr.e_ident[5] != ELFDATA2LSB ||