EdouardBERGE / rasm

RASM powerful Z80 assembler
129 stars 16 forks source link

Compilation issue on Mac OS 10.15.5 #7

Closed sebastiengoutal closed 3 years ago

sebastiengoutal commented 3 years ago

I got these warnings and error while compiling on Mac OS 10.15.5:

cc rasm.c -lm -lrt -march=native -o rasm.exe
rasm.c:3695:32: warning: unsequenced modification and access to 'idx' [-Wunsequenced]
        while (oplist[idx]) oplist[idx++]=toupper(oplist[idx]);
                                      ^                  ~~~
rasm.c:3738:32: warning: unsequenced modification and access to 'idx' [-Wunsequenced]
        while (oplist[idx]) oplist[idx++]=toupper(oplist[idx]);
                                      ^                  ~~~
rasm.c:13262:17: warning: passing 'unsigned char *' to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
        while (strncmp(subchunk,"data",4)) {
                       ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/string.h:84:26: note: passing argument to parameter '__s1' here
int      strncmp(const char *__s1, const char *__s2, size_t __n);
                             ^
rasm.c:14491:72: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
        InitAutomate(ae->AutomateExpressionValidCharExtended,(unsigned char *)AutomateExpressionValidCharExtendedDefinition);
                                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rasm.c:1132:106: note: expanded from macro 'AutomateExpressionValidCharExtendedDefinition'
#define AutomateExpressionValidCharExtendedDefinition "0123456789.ABCDEFGHIJKLMNOPQRSTUVWXYZ_{}@+-*/~^$#%<A7><=>|&"
                                                                                                         ^~~~
rasm.c:15382:36: warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
                                                FileWriteBinary(TMP_filename,ae->mem[i]+offset,endoffset-offset);
                                                                             ^~~~~~~~~~~~~~~~~
./minilib.h:895:42: note: passing argument to parameter 'data' here
int FileWriteBinary(char *filename,char *data,int n)
                                         ^
rasm.c:19143:41: warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
        FileWriteBinary("autotest_include.raw",opcode,idx);
                                               ^~~~~~
./minilib.h:895:42: note: passing argument to parameter 'data' here
int FileWriteBinary(char *filename,char *data,int n)
                                         ^
rasm.c:19825:36: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
printf(" * Inspired by cap by Sven-<C5>ke Dahl. https://github.com/svendahl/cap\n");
                                   ^~~~
7 warnings generated.
ld: library not found for -lrt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [prod] Error 1

Removing -lrt from Makefile seems to solve the compilation error.

EdouardBERGE commented 3 years ago

i fixed most of them, thanks