jaylogue / retro-fuse

A FUSE module for accessing ancient Unix filesystems.
Other
58 stars 3 forks source link

Retro-fuse won't compile on M2 MacBook Pro #6

Closed pcollinson closed 1 year ago

pcollinson commented 1 year ago

Just installed MacFuse on M2 MacBook Pro. Cloned retro-fuse and typed 'make' - and then 'make v6fs' both attempts say:

retro-fuse# make v6fs
cc -std=c11 -g -Wall -O0 -fno-common -DFUSE_USE_VERSION=26 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_XOPEN_SOURCE=700 -D_ATFILE_SOURCE -D_DARWIN_C_SOURCE -MMD -MP -I./src  -c -o src/fusecommon.o src/fusecommon.c
src/fusecommon.c:162:25: error: call to undeclared function 'rindex'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    retrofuse_cmdname = rindex(argv[0], '/');
                        ^
src/fusecommon.c:162:23: warning: incompatible integer to pointer conversion assigning to 'const char *' from 'int' [-Wint-conversion]
    retrofuse_cmdname = rindex(argv[0], '/');
                      ^ ~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
make: *** [src/fusecommon.o] Error

Some of the compiler error formatting is lost. Any ideas? I suspect that the current Clang C compiler may not compile old code like gcc used to. However, I am unsure.

jaylogue commented 1 year ago

Thank you for reporting this, Peter. I'm on vacation now and don't have my Mac with me, so I can't test a fix. However I think if you change fusecommon.c, line 162 to call to call strrchr() instead of rindex() it should compile correctly. I've opened a pull request with this change which you can try: https://github.com/jaylogue/retro-fuse/pull/7

If you still have problems, I will take a look at it when I'm back at my computer on July 16th.

pcollinson commented 1 year ago

Yup that worked and I have a v6 filesystem on Ventura. Many thanks.