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.
I got these warnings and error while compiling on Mac OS 10.15.5:
Removing
-lrt
fromMakefile
seems to solve the compilation error.