|
From: <sv...@va...> - 2009-02-23 07:38:37
|
Author: njn
Date: 2009-02-23 07:38:33 +0000 (Mon, 23 Feb 2009)
New Revision: 9241
Log:
Merged r9237..r9240 ('make check' warning fixes, mostly) from the trunk.
Modified:
branches/DARWIN/callgrind/fn.c
branches/DARWIN/drd/tests/pth_barrier_race.c
branches/DARWIN/exp-ptrcheck/tests/Makefile.am
branches/DARWIN/exp-ptrcheck/tests/stackerr.c
branches/DARWIN/exp-ptrcheck/tests/tricky.c
branches/DARWIN/massif/ms_main.c
branches/DARWIN/massif/tests/ignored.c
branches/DARWIN/massif/tests/malloc_usable.c
branches/DARWIN/memcheck/tests/Makefile.am
branches/DARWIN/memcheck/tests/malloc_usable.c
branches/DARWIN/memcheck/tests/memalign2.c
branches/DARWIN/memcheck/tests/str_tester.c
branches/DARWIN/none/tests/coolo_sigaction.cpp
branches/DARWIN/none/tests/fdleak_cmsg.c
branches/DARWIN/none/tests/rlimit_nofile.c
branches/DARWIN/none/tests/susphello.c
branches/DARWIN/perf/Makefile.am
branches/DARWIN/perf/tinycc.c
Modified: branches/DARWIN/callgrind/fn.c
===================================================================
--- branches/DARWIN/callgrind/fn.c 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/callgrind/fn.c 2009-02-23 07:38:33 UTC (rev 9241)
@@ -44,6 +44,7 @@
struct chunk_t chunk[];
};
+#if defined(HAVE_ELF)
/* Scan for a pattern in the code of an ELF object.
* If found, return true and set runtime_resolve_{addr,length}
*/
@@ -102,8 +103,9 @@
CLG_DEBUG(1, " found nothing.\n");
return False;
}
-
+#endif // HAVE_ELF
+
/* _ld_runtime_resolve, located in ld.so, needs special handling:
* The jump at end into the resolved function should not be
* represented as a call (as usually done in callgrind with jumps),
Modified: branches/DARWIN/drd/tests/pth_barrier_race.c
===================================================================
--- branches/DARWIN/drd/tests/pth_barrier_race.c 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/drd/tests/pth_barrier_race.c 2009-02-23 07:38:33 UTC (rev 9241)
@@ -12,8 +12,8 @@
#include <pthread.h>
#include <stdlib.h>
+#include <unistd.h>
-
static pthread_barrier_t* barrier;
Modified: branches/DARWIN/exp-ptrcheck/tests/Makefile.am
===================================================================
--- branches/DARWIN/exp-ptrcheck/tests/Makefile.am 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/exp-ptrcheck/tests/Makefile.am 2009-02-23 07:38:33 UTC (rev 9241)
@@ -88,7 +88,7 @@
# To make it a bit more realistic, build hackedbz2.c with at
# least some optimisation.
-hackedbz2_CFLAGS = $(AM_CFLAGS) -O
+hackedbz2_CFLAGS = $(AM_CFLAGS) -O -Wno-inline
# C ones
pth_create_LDADD = -lpthread
Modified: branches/DARWIN/exp-ptrcheck/tests/stackerr.c
===================================================================
--- branches/DARWIN/exp-ptrcheck/tests/stackerr.c 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/exp-ptrcheck/tests/stackerr.c 2009-02-23 07:38:33 UTC (rev 9241)
@@ -43,10 +43,11 @@
for (i = 0; i < 7+1; i++) {
a[i] = 0;
}
- char beforebuf[8];
+ {char beforebuf[8];
char buf[8];
char afterbuf[8];
sprintf(buf, "%d", 123456789);
return 1 & ((a[4] + beforea[1] + aftera[1] + beforebuf[1]
+ buf[2] + afterbuf[3]) / 100000) ;
+ }
}
Modified: branches/DARWIN/exp-ptrcheck/tests/tricky.c
===================================================================
--- branches/DARWIN/exp-ptrcheck/tests/tricky.c 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/exp-ptrcheck/tests/tricky.c 2009-02-23 07:38:33 UTC (rev 9241)
@@ -8,10 +8,12 @@
// to zero.
int u[20];
int* p = malloc(sizeof(int) * 100);
-
+ int* n;
+ int* x;
+
p[0] = 0; // ok
- int* n = (int*)((long)p + (long)u); // result is n, because near zero!
- int* x = (int*)((long)n - (long)u); // x == p
+ n = (int*)((long)p + (long)u); // result is n, because near zero!
+ x = (int*)((long)n - (long)u); // x == p
x[0] = 0; // ok, originally caused false pos.
return 0;
Modified: branches/DARWIN/massif/ms_main.c
===================================================================
--- branches/DARWIN/massif/ms_main.c 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/massif/ms_main.c 2009-02-23 07:38:33 UTC (rev 9241)
@@ -220,8 +220,6 @@
VG_(message)(Vg_DebugMsg, "Massif: " format, ##args); \
}
-
-
//------------------------------------------------------------//
//--- Statistics ---//
//------------------------------------------------------------//
@@ -370,7 +368,7 @@
// a UInt, but this caused problems on 64-bit machines when it was
// multiplied by a small negative number and then promoted to a
// word-sized type -- it ended up with a value of 4.2 billion. Sigh.
-static SizeT clo_heap_admin = 8;
+static SSizeT clo_heap_admin = 8;
static Bool clo_stacks = False;
static UInt clo_depth = 30;
static double clo_threshold = 1.0; // percentage
@@ -1298,7 +1296,7 @@
// in /usr/include/time.h on Darwin.
static void
take_snapshot(Snapshot* snapshot, SnapshotKind kind, Time my_time,
- Bool is_detailed, Char* what)
+ Bool is_detailed)
{
tl_assert(!is_snapshot_in_use(snapshot));
tl_assert(have_started_executing_code);
@@ -1386,7 +1384,7 @@
// Take the snapshot.
snapshot = & snapshots[next_snapshot_i];
- take_snapshot(snapshot, kind, my_time, is_detailed, what);
+ take_snapshot(snapshot, kind, my_time, is_detailed);
// Record if it was detailed.
if (is_detailed) {
@@ -1503,7 +1501,7 @@
Bool is_custom_alloc = (NULL != p);
SizeT actual_szB, slop_szB;
- if (req_szB < 0) return NULL;
+ if ((SSizeT)req_szB < 0) return NULL;
// Allocate and zero if necessary
if (!p) {
@@ -1746,7 +1744,7 @@
return new_block( tid, NULL, szB, alignB, False );
}
-static void ms_free ( ThreadId tid, void* p )
+static void ms_free ( ThreadId tid __attribute__((unused)), void* p )
{
die_block( p, /*custom_free*/False );
}
@@ -1766,7 +1764,7 @@
return renew_block(tid, p_old, new_szB);
}
-static SizeT ms_malloc_usable_size ( ThreadId tid, void* p )
+static SizeT ms_malloc_usable_size ( ThreadId tid, void* p )
{
HP_Chunk* hc = VG_(HT_lookup)( malloc_list, (UWord)p );
@@ -1788,7 +1786,7 @@
update_alloc_stats(stack_szB_delta);
}
-static INLINE void new_mem_stack_2(Addr a, SizeT len, Char* what)
+static INLINE void new_mem_stack_2(SizeT len, Char* what)
{
if (have_started_executing_code) {
VERB(3, "<<< new_mem_stack (%ld)", len);
@@ -1799,7 +1797,7 @@
}
}
-static INLINE void die_mem_stack_2(Addr a, SizeT len, Char* what)
+static INLINE void die_mem_stack_2(SizeT len, Char* what)
{
if (have_started_executing_code) {
VERB(3, "<<< die_mem_stack (%ld)", -len);
@@ -1813,22 +1811,22 @@
static void new_mem_stack(Addr a, SizeT len)
{
- new_mem_stack_2(a, len, "stk-new");
+ new_mem_stack_2(len, "stk-new");
}
static void die_mem_stack(Addr a, SizeT len)
{
- die_mem_stack_2(a, len, "stk-die");
+ die_mem_stack_2(len, "stk-die");
}
static void new_mem_stack_signal(Addr a, SizeT len, ThreadId tid)
{
- new_mem_stack_2(a, len, "sig-new");
+ new_mem_stack_2(len, "sig-new");
}
static void die_mem_stack_signal(Addr a, SizeT len)
{
- die_mem_stack_2(a, len, "sig-die");
+ die_mem_stack_2(len, "sig-die");
}
Modified: branches/DARWIN/massif/tests/ignored.c
===================================================================
--- branches/DARWIN/massif/tests/ignored.c 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/massif/tests/ignored.c 2009-02-23 07:38:33 UTC (rev 9241)
@@ -45,5 +45,7 @@
ignore2(x, ignored_x);
x = realloc(ignored_x, 0); // equivalent to 'free(ignored_x)'.
+
+ return 0;
}
Modified: branches/DARWIN/massif/tests/malloc_usable.c
===================================================================
--- branches/DARWIN/massif/tests/malloc_usable.c 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/massif/tests/malloc_usable.c 2009-02-23 07:38:33 UTC (rev 9241)
@@ -9,12 +9,12 @@
int main(void)
{
+# if !defined(_AIX) && !defined(__APPLE__)
// Because our allocations are in multiples of 8 or 16, 99 will round up
// to 104 or 112.
int* x = malloc(99);
- // DDD: would be better to have a HAVE_MALLOC_USABLE_SIZE variable here
-# if !defined(_AIX) && !defined(__APPLE__)
+ // XXX: would be better to have a HAVE_MALLOC_USABLE_SIZE variable here
assert(104 == malloc_usable_size(x) ||
112 == malloc_usable_size(x));
assert( 0 == malloc_usable_size(NULL));
Modified: branches/DARWIN/memcheck/tests/Makefile.am
===================================================================
--- branches/DARWIN/memcheck/tests/Makefile.am 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/memcheck/tests/Makefile.am 2009-02-23 07:38:33 UTC (rev 9241)
@@ -226,23 +226,44 @@
wrap1 wrap2 wrap3 wrap4 wrap5 wrap6 wrap7 wrap7so.so wrap8 \
writev zeropage
+
AM_CFLAGS += $(AM_FLAG_M3264_PRI)
AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
-# Extra stuff for C tests
+deep_templates_SOURCES = deep_templates.cpp
+deep_templates_CXXFLAGS = $(AM_CFLAGS) -O -gstabs
+
+long_namespace_xml_SOURCES = long_namespace_xml.cpp
+
memcmptest_CFLAGS = $(AM_CFLAGS) -fno-builtin-memcmp
-vcpu_bz2_CFLAGS = $(AM_CFLAGS) -O2
-vcpu_fbench_CFLAGS = $(AM_CFLAGS) -O2
-vcpu_fnfns_CFLAGS = $(AM_CFLAGS) -O2
-vcpu_fnfns_LDADD = -lm
-wrap6_CFLAGS = $(AM_CFLAGS) -O2
+mismatches_SOURCES = mismatches.cpp
+
+new_nothrow_SOURCES = new_nothrow.cpp
+new_override_SOURCES = new_override.cpp
+
+# This requires optimisation in order to get just one resulting error.
+origin4_many_CFLAGS = $(AM_CFLAGS) -O
+
+# Apply -O so as to run in reasonable time.
+origin5_bz2_CFLAGS = $(AM_CFLAGS) -O -Wno-inline
+origin6_fp_CFLAGS = $(AM_CFLAGS) -O
+
# Don't allow GCC to inline memcpy(), because then we can't intercept it
overlap_CFLAGS = $(AM_CFLAGS) -fno-builtin-memcpy
+
str_tester_CFLAGS = $(AM_CFLAGS) -Wno-shadow
+
supp_unknown_SOURCES = badjump.c
supp1_SOURCES = supp.c
supp2_SOURCES = supp.c
+
+vcpu_bz2_CFLAGS = $(AM_CFLAGS) -O2
+vcpu_fbench_CFLAGS = $(AM_CFLAGS) -O2
+vcpu_fnfns_CFLAGS = $(AM_CFLAGS) -O2
+vcpu_fnfns_LDADD = -lm
+wrap6_CFLAGS = $(AM_CFLAGS) -O2
+
# To make it a bit more realistic, have some optimisation enabled
# for the varinfo tests. We still expect sane results.
varinfo1_CFLAGS = $(AM_CFLAGS) -O
@@ -251,20 +272,7 @@
varinfo4_CFLAGS = $(AM_CFLAGS) -O
varinfo5_CFLAGS = $(AM_CFLAGS) -O
varinfo6_CFLAGS = $(AM_CFLAGS) -O
-# This requires optimisation in order to get just one resulting error.
-origin4_many_CFLAGS = $(AM_CFLAGS) -O
-# Apply -O so as to run in reasonable time.
-origin5_bz2_CFLAGS = $(AM_CFLAGS) -O
-origin6_fp_CFLAGS = $(AM_CFLAGS) -O
-# C++ tests
-mismatches_SOURCES = mismatches.cpp
-new_nothrow_SOURCES = new_nothrow.cpp
-new_override_SOURCES = new_override.cpp
-deep_templates_SOURCES = deep_templates.cpp
-long_namespace_xml_SOURCES = long_namespace_xml.cpp
-deep_templates_CXXFLAGS = $(AM_CFLAGS) -O -gstabs
-
if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5
if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5
else
@@ -282,89 +290,88 @@
endif
endif
-# Build shared object for wrap7
-wrap7_SOURCES = wrap7.c
-wrap7_DEPENDENCIES = wrap7so.so
+# Build shared object for varinfo5
+varinfo5_SOURCES = varinfo5.c
+varinfo5_DEPENDENCIES = varinfo5so.so
if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5
- wrap7_LDADD = `pwd`/wrap7so.so
- wrap7_LDFLAGS = $(AM_FLAG_M3264_PRI)
+ varinfo5_LDADD = `pwd`/varinfo5so.so
+ varinfo5_LDFLAGS = $(AM_FLAG_M3264_PRI)
else
if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5
- wrap7_LDADD = `pwd`/wrap7so.so
- wrap7_LDFLAGS = $(AM_FLAG_M3264_PRI) -Wl,-G -Wl,-bnogc
+ varinfo5_LDADD = `pwd`/varinfo5so.so
+ varinfo5_LDFLAGS = $(AM_FLAG_M3264_PRI) -Wl,-G -Wl,-bnogc
else
if VGCONF_OS_IS_DARWIN
- wrap7_LDADD = `pwd`/wrap7so.so
- wrap7_LDFLAGS = $(AM_FLAG_M3264_PRI)
+ varinfo5_LDADD = `pwd`/varinfo5so.so
+ varinfo5_LDFLAGS = $(AM_FLAG_M3264_PRI)
else
- wrap7_LDADD = wrap7so.so
- wrap7_LDFLAGS = $(AM_FLAG_M3264_PRI) \
+ varinfo5_LDADD = varinfo5so.so
+ varinfo5_LDFLAGS = $(AM_FLAG_M3264_PRI) \
-Wl,-rpath,$(top_builddir)/memcheck/tests
endif
endif
-endif
-wrap7so_so_SOURCES = wrap7so.c
-wrap7so_so_LDADD =
-wrap7so_so_DEPENDENCIES =
-wrap7so_so_CFLAGS = $(AM_CFLAGS) -fpic
+varinfo5so_so_SOURCES = varinfo5so.c
+varinfo5so_so_LDADD =
+varinfo5so_so_DEPENDENCIES =
+varinfo5so_so_CFLAGS = $(AM_CFLAGS) -fpic -O -Wno-shadow
if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5
- wrap7so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared
+ varinfo5so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared
else
if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5
- wrap7so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared \
+ varinfo5so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared \
-Wl,-G -Wl,-bnogc
else
if VGCONF_OS_IS_DARWIN
- wrap7so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -dynamic \
+ varinfo5so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -dynamic \
-dynamiclib -all_load
else
- wrap7so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared \
- -Wl,-soname -Wl,wrap7so.so
+ varinfo5so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared \
+ -Wl,-soname -Wl,varinfo5so.so
endif
endif
endif
-# Build shared object for varinfo5
-varinfo5_SOURCES = varinfo5.c
-varinfo5_DEPENDENCIES = varinfo5so.so
+# Build shared object for wrap7
+wrap7_SOURCES = wrap7.c
+wrap7_DEPENDENCIES = wrap7so.so
if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5
- varinfo5_LDADD = `pwd`/varinfo5so.so
- varinfo5_LDFLAGS = $(AM_FLAG_M3264_PRI)
+ wrap7_LDADD = `pwd`/wrap7so.so
+ wrap7_LDFLAGS = $(AM_FLAG_M3264_PRI)
else
if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5
- varinfo5_LDADD = `pwd`/varinfo5so.so
- varinfo5_LDFLAGS = $(AM_FLAG_M3264_PRI) -Wl,-G -Wl,-bnogc
+ wrap7_LDADD = `pwd`/wrap7so.so
+ wrap7_LDFLAGS = $(AM_FLAG_M3264_PRI) -Wl,-G -Wl,-bnogc
else
if VGCONF_OS_IS_DARWIN
- varinfo5_LDADD = `pwd`/varinfo5so.so
- varinfo5_LDFLAGS = $(AM_FLAG_M3264_PRI)
+ wrap7_LDADD = `pwd`/wrap7so.so
+ wrap7_LDFLAGS = $(AM_FLAG_M3264_PRI)
else
- varinfo5_LDADD = varinfo5so.so
- varinfo5_LDFLAGS = $(AM_FLAG_M3264_PRI) \
+ wrap7_LDADD = wrap7so.so
+ wrap7_LDFLAGS = $(AM_FLAG_M3264_PRI) \
-Wl,-rpath,$(top_builddir)/memcheck/tests
endif
endif
endif
-varinfo5so_so_SOURCES = varinfo5so.c
-varinfo5so_so_LDADD =
-varinfo5so_so_DEPENDENCIES =
-varinfo5so_so_CFLAGS = $(AM_CFLAGS) -fpic -O
+wrap7so_so_SOURCES = wrap7so.c
+wrap7so_so_CFLAGS = $(AM_CFLAGS) -fpic
if VGCONF_PLATFORMS_INCLUDE_PPC64_AIX5
- varinfo5so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared
+ wrap7so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared
else
if VGCONF_PLATFORMS_INCLUDE_PPC32_AIX5
- varinfo5so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared \
+ wrap7so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared \
-Wl,-G -Wl,-bnogc
else
if VGCONF_OS_IS_DARWIN
- varinfo5so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -dynamic \
+ wrap7so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -dynamic \
-dynamiclib -all_load
else
- varinfo5so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared \
- -Wl,-soname -Wl,varinfo5so.so
+ wrap7so_so_LDFLAGS = -fpic $(AM_FLAG_M3264_PRI) -shared \
+ -Wl,-soname -Wl,wrap7so.so
endif
endif
endif
+endif
+
Modified: branches/DARWIN/memcheck/tests/malloc_usable.c
===================================================================
--- branches/DARWIN/memcheck/tests/malloc_usable.c 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/memcheck/tests/malloc_usable.c 2009-02-23 07:38:33 UTC (rev 9241)
@@ -9,12 +9,12 @@
int main(void)
{
+# if !defined(_AIX) && !defined(__APPLE__)
// Because Memcheck marks any slop as inaccessible, it doesn't round up
// sizes for malloc_usable_size().
int* x = malloc(99);
- // DDD: would be better to have a HAVE_MALLOC_USABLE_SIZE variable here
-# if !defined(_AIX) && !defined(__APPLE__)
+ // XXX: would be better to have a HAVE_MALLOC_USABLE_SIZE variable here
assert(99 == malloc_usable_size(x));
assert( 0 == malloc_usable_size(NULL));
assert( 0 == malloc_usable_size((void*)0xdeadbeef));
Modified: branches/DARWIN/memcheck/tests/memalign2.c
===================================================================
--- branches/DARWIN/memcheck/tests/memalign2.c 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/memcheck/tests/memalign2.c 2009-02-23 07:38:33 UTC (rev 9241)
@@ -23,6 +23,13 @@
int main ( void )
{
+# if defined(_AIX)
+ printf("AIX 5.2 knows about neither memalign() nor posix_memalign().\n");
+
+# elif defined(__APPLE__)
+ printf("MacOS X knows about neither memalign() nor posix_memalign().\n");
+
+# else
// Nb: assuming VG_MIN_MALLOC_SZB is 8!
// Should work with both 32-bit and 64-bit pointers, though.
@@ -30,14 +37,6 @@
int res;
assert(sizeof(long int) == sizeof(void*));
-# if defined(_AIX)
- printf("AIX 5.2 knows about neither memalign() nor posix_memalign().\n");
-
-# else
-# if defined(__APPLE__)
- printf("MacOS X knows about neither memalign() nor posix_memalign().\n");
-
-# else
p = memalign(0, 100); assert(0 == (long)p % 8);
p = memalign(1, 100); assert(0 == (long)p % 8);
p = memalign(2, 100); assert(0 == (long)p % 8);
@@ -78,7 +77,6 @@
res = PM(&p, 4097, 100); assert(EINVAL == res);
# endif
-# endif
return 0;
}
Modified: branches/DARWIN/memcheck/tests/str_tester.c
===================================================================
--- branches/DARWIN/memcheck/tests/str_tester.c 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/memcheck/tests/str_tester.c 2009-02-23 07:38:33 UTC (rev 9241)
@@ -1059,7 +1059,7 @@
}
}
-#if !defined(_AIX)
+#if !defined(_AIX) && !defined(__APPLE__)
static void
test_mempcpy (void)
{
@@ -1463,7 +1463,7 @@
/* memmove - must work on overlap. */
test_memmove ();
-# if !defined(_AIX)
+# if !defined(_AIX) && !defined(__APPLE__)
/* mempcpy */
test_mempcpy ();
# endif
Modified: branches/DARWIN/none/tests/coolo_sigaction.cpp
===================================================================
--- branches/DARWIN/none/tests/coolo_sigaction.cpp 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/none/tests/coolo_sigaction.cpp 2009-02-23 07:38:33 UTC (rev 9241)
@@ -42,11 +42,12 @@
{
int i;
char buffer[200];
+ size_t dummy_size_t;
setupHandlers();
FILE *p = popen("echo Hallo World", "r");
while (!feof(p)) {
int n = fread(buffer, 200, 1, p);
- write(2, buffer, n);
+ dummy_size_t = write(2, buffer, n);
}
fclose(p);
for (i = 0; i < 1000000; i++) ;
Modified: branches/DARWIN/none/tests/fdleak_cmsg.c
===================================================================
--- branches/DARWIN/none/tests/fdleak_cmsg.c 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/none/tests/fdleak_cmsg.c 2009-02-23 07:38:33 UTC (rev 9241)
@@ -18,7 +18,7 @@
# include <memory.h>
#endif
-
+#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/un.h>
@@ -59,7 +59,7 @@
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
- sprintf(addr.sun_path, sock);
+ sprintf(addr.sun_path, "%s", sock);
unlink(addr.sun_path);
if(bind(s, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
@@ -135,7 +135,7 @@
}
addr.sun_family = AF_UNIX;
- sprintf(addr.sun_path, sock);
+ sprintf(addr.sun_path, "%s", sock);
do {
count++;
Modified: branches/DARWIN/none/tests/rlimit_nofile.c
===================================================================
--- branches/DARWIN/none/tests/rlimit_nofile.c 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/none/tests/rlimit_nofile.c 2009-02-23 07:38:33 UTC (rev 9241)
@@ -37,14 +37,16 @@
if (newrlim.rlim_cur != oldrlim.rlim_cur / 2)
{
- fprintf(stderr, "rlim_cur is %lu (should be %lu)\n",
- newrlim.rlim_cur, oldrlim.rlim_cur / 2);
+ fprintf(stderr, "rlim_cur is %llu (should be %llu)\n",
+ (unsigned long long)newrlim.rlim_cur,
+ (unsigned long long)oldrlim.rlim_cur / 2);
}
if (newrlim.rlim_max != oldrlim.rlim_max)
{
- fprintf(stderr, "rlim_max is %lu (should be %lu)\n",
- newrlim.rlim_max, oldrlim.rlim_max);
+ fprintf(stderr, "rlim_max is %llu (should be %llu)\n",
+ (unsigned long long)newrlim.rlim_max,
+ (unsigned long long)oldrlim.rlim_max);
}
newrlim.rlim_cur -= 3; /* allow for stdin, stdout and stderr */
Modified: branches/DARWIN/none/tests/susphello.c
===================================================================
--- branches/DARWIN/none/tests/susphello.c 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/none/tests/susphello.c 2009-02-23 07:38:33 UTC (rev 9241)
@@ -316,6 +316,7 @@
#else
+#include <stdio.h>
int main(int argc, char **argv) {
printf("PASSED\n");
return 0;
Modified: branches/DARWIN/perf/Makefile.am
===================================================================
--- branches/DARWIN/perf/Makefile.am 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/perf/Makefile.am 2009-02-23 07:38:33 UTC (rev 9241)
@@ -23,7 +23,9 @@
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
Modified: branches/DARWIN/perf/tinycc.c
===================================================================
--- branches/DARWIN/perf/tinycc.c 2009-02-23 07:28:54 UTC (rev 9240)
+++ branches/DARWIN/perf/tinycc.c 2009-02-23 07:38:33 UTC (rev 9241)
@@ -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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 ||
@@ -20600,7 +20606,7 @@
void rt_error(ucontext_t *uc, const char *fmt, ...)
{
va_list ap;
- unsigned long pc;
+ unsigned long pc = 0; // shut gcc up
int i;
va_start(ap, fmt);
|