demo: fix 'mini_c' compile errors with GCC 8.3.0

Fixes #3341
This commit is contained in:
Christian Prochaska 2019-05-06 14:24:50 +02:00 committed by Christian Helmuth
parent dd6bd0f880
commit 2b21f41495
3 changed files with 4 additions and 5 deletions

View File

@ -17,7 +17,7 @@
#include <stdarg.h>
#include <stddef.h>
#define FILE int
#define FILE void
#define EOF (-1)

View File

@ -14,9 +14,8 @@
#include <base/log.h>
#include <base/sleep.h>
extern "C" void *abort(void)
extern "C" void abort(void)
{
Genode::warning("abort called");
Genode::sleep_forever();
return 0;
}

View File

@ -32,7 +32,7 @@ static Allocator &alloc()
void mini_c_init(Allocator &alloc) { _alloc_ptr = &alloc; }
extern "C" void *malloc(unsigned size)
extern "C" void *malloc(size_t size)
{
/*
* We store the size of the allocation at the very
@ -50,7 +50,7 @@ extern "C" void *malloc(unsigned size)
}
extern "C" void *calloc(unsigned nmemb, unsigned size)
extern "C" void *calloc(size_t nmemb, size_t size)
{
void *addr = malloc(nmemb*size);
memset(addr, 0, nmemb*size);