fix warnings

This commit is contained in:
Danya Berezun 2023-09-04 21:44:26 +02:00
parent 9170b9c860
commit 17a7aa0116
5 changed files with 14 additions and 13 deletions

View file

@ -1,8 +1,10 @@
FLAGS=-no-pie -m32 -g2 -fstack-protector-all
all: byterun.o all: byterun.o
$(CC) -m32 -g -o byterun byterun.o ../runtime/runtime.a $(CC) $(FLAGS) -o byterun byterun.o ../runtime/runtime.a
byterun.o: byterun.c byterun.o: byterun.c
$(CC) -g -fstack-protector-all -m32 -c byterun.c $(CC) $(FLAGS) -g -c byterun.c
clean: clean:
$(RM) *.a *.o *~ $(RM) *.a *.o *~ byterun

View file

@ -1,5 +1,5 @@
CC=gcc CC=gcc
FLAGS=-m32 -g2 -fstack-protector-all -DLAMA_ENV FLAGS=-no-pie -m32 -g2 -fstack-protector-all -DLAMA_ENV
all: gc_runtime.o gc.o runtime.o all: gc_runtime.o gc.o runtime.o
ar rc runtime.a gc_runtime.o runtime.o gc.o ar rc runtime.a gc_runtime.o runtime.o gc.o

View file

@ -460,11 +460,11 @@ void physically_relocate (memory_chunk *old_heap) {
#endif #endif
} }
bool is_valid_heap_pointer (const size_t *p) { inline bool is_valid_heap_pointer (const size_t *p) {
return !UNBOXED(p) && (size_t)heap.begin <= (size_t)p && (size_t)p <= (size_t)heap.current; return !UNBOXED(p) && (size_t)heap.begin <= (size_t)p && (size_t)p <= (size_t)heap.current;
} }
bool is_valid_pointer (const size_t *p) { return !UNBOXED(p); } static inline bool is_valid_pointer (const size_t *p) { return !UNBOXED(p); }
static inline void queue_enqueue (heap_iterator *tail_iter, void *obj) { static inline void queue_enqueue (heap_iterator *tail_iter, void *obj) {
void *tail = tail_iter->current; void *tail = tail_iter->current;

View file

@ -65,8 +65,7 @@ void *gc_alloc_on_existing_heap(size_t);
void mark (void *obj); void mark (void *obj);
void mark_phase (void); void mark_phase (void);
// written in ASM, scans stack for pointers to the heap and starts marking process // written in ASM, scans stack for pointers to the heap and starts marking process
extern void extern void __gc_root_scan_stack (void);
__gc_root_scan_stack (void);
// marks each pointer from extra roots // marks each pointer from extra roots
void scan_extra_roots (void); void scan_extra_roots (void);
#ifdef LAMA_ENV #ifdef LAMA_ENV
@ -93,9 +92,9 @@ extern void __pre_gc (void);
extern void __post_gc (void); extern void __post_gc (void);
// invoked from ASM // invoked from ASM
extern void gc_test_and_mark_root (size_t **root); extern void gc_test_and_mark_root (size_t **root);
inline bool is_valid_heap_pointer (const size_t *); bool is_valid_heap_pointer (const size_t *);
inline bool is_valid_pointer (const size_t *); static inline bool is_valid_pointer (const size_t *);
void clear_extra_roots (void); void clear_extra_roots (void);

View file

@ -820,7 +820,7 @@ extern void *Bclosure (int bn, void *entry, ...) {
for (i = 0; i < n; i++, argss++) { push_extra_root((void **)argss); } for (i = 0; i < n; i++, argss++) { push_extra_root((void **)argss); }
r = (data *)alloc_closure(n + 1); r = (data *)alloc_closure(n + 1);
push_extra_root(&r); push_extra_root((void **)&r);
((void **)r->contents)[0] = entry; ((void **)r->contents)[0] = entry;
va_start(args, entry); va_start(args, entry);
@ -834,7 +834,7 @@ extern void *Bclosure (int bn, void *entry, ...) {
POST_GC(); POST_GC();
pop_extra_root(&r); pop_extra_root((void **)&r);
argss--; argss--;
for (i = 0; i < n; i++, argss--) { pop_extra_root((void **)argss); } for (i = 0; i < n; i++, argss--) { pop_extra_root((void **)argss); }
return r->contents; return r->contents;