Opened 4 years ago

#60772 assigned defect

chez-scheme @9.5.2: error: cast to 'ptr' (aka 'void *') from smaller integer type

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: mohd-akram (Mohamed Akram)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc:
Port: chez-scheme

Description

chez-scheme fails to build with newer compilers:

alloc.c:49:9: error: cast to 'ptr' (aka 'void *') from smaller integer type 'unsigned int' [-Werror,-Wint-to-void-pointer-cast]
        find_room(space_new, 0, type_typed_object, size_vector(0), S_G.null_vector);
        ^
./types.h:84:26: note: expanded from macro 'find_room'
    S_G.next_loc[s][g] = (ptr)((uptr)X + (n));\
                         ^
alloc.c:49:9: error: cast to 'ptr' (aka 'void *') from smaller integer type 'int' [-Werror,-Wint-to-void-pointer-cast]
./types.h:86:11: note: expanded from macro 'find_room'
    (x) = TYPE(X, t);\
          ^
./types.h:229:23: note: expanded from macro 'TYPE'
#define TYPE(x,type) ((ptr)((iptr)(x) - typemod + (type)))
                      ^
alloc.c:50:9: error: cast to 'iptr *' (aka 'int *') from smaller integer type 'unsigned int' [-Werror,-Wint-to-pointer-cast]
        VECTTYPE(S_G.null_vector) = (0 << vector_length_offset) | type_vector;
        ^
../boot/ti3osx/equates.h:795:24: note: expanded from macro 'VECTTYPE'
#define VECTTYPE(x) (*((iptr *)((uptr)(x)+1)))
                       ^

Older compilers probably didn't have this warning.

This demonstrates why we don't want ports to build with -Werror.

Change History (0)

Note: See TracTickets for help on using tickets.