Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation on error (and warnings) os osx 10.11.5 #2

Open
ghost opened this issue Jul 14, 2016 · 2 comments
Open

compilation on error (and warnings) os osx 10.11.5 #2

ghost opened this issue Jul 14, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 14, 2016

Hi,

I'm trying to compile execfuse on osx, but I hit the following error .. Maybe someone will be able to advise what to do to fix them ?

cc -O2 -ggdb -Wall execfuse.c chunked_buffer.c execute_script.c -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -I/usr/local/include/osxfuse/fuse -L/usr/local/lib -losxfuse -pthread -liconv -o execfuse
execfuse.c:47:11: warning: format specifies type 'int ' but the argument has type 'nlink_t *' (aka 'unsigned short *') [-Wformat]
,&stbuf->st_nlink
^~~~~~~~~~~~~~~~
execfuse.c:50:11: warning: format specifies type 'long long *' but the argument has type 'dev_t *' (aka 'int *') [-Wformat]
,&stbuf->st_rdev
^~~~~~~~~~~~~~~
execfuse.c:52:11: warning: format specifies type 'long *' but the argument has type 'blksize_t *' (aka 'int *') [-Wformat]
,&stbuf->st_blksize
^~~~~~~~~~~~~~~~~~
execfuse.c:273:5: warning: 'sem_init' is deprecated [-Wdeprecated-declarations]
sem_init(&i->sem, 0, 1);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/semaphore.h:55:5: note: 'sem_init' has been explicitly
marked deprecated here
int sem_init(sem_t *, int, unsigned int) *deprecated;
^
execfuse.c:378:5: warning: 'sem_destroy' is deprecated [-Wdeprecated-declarations]
sem_destroy(&i->sem);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/sys/semaphore.h:53:5: note: 'sem_destroy' has been explicitly
marked deprecated here
int sem_destroy(sem_t ) __deprecated;
^
execfuse.c:420:33: warning: format specifies type 'unsigned long long' but the argument has type 'dev_t' (aka 'int') [-Wformat]
sprintf(b, "0x%016llx", rdev);
~~~~~~~ ^~~~
%016x
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
__builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS
)
^~~~~~~~~~~
execfuse.c:525:6: error: field designator 'flag_nullpath_ok' does not refer to any field in type 'struct fuse_operations'
.flag_nullpath_ok = 1,
^
6 warnings and 1 error generated.
execute_script.c:37:2: warning: implicitly declaring library function 'sprintf' with type 'int (char *, const char *, ...)' [-Wimplicit-function-declaration]
sprintf(script_path, "%s/%s", directory, script_name);
^
execute_script.c:37:2: note: include the header <stdio.h> or explicitly provide a declaration for 'sprintf'
1 warning generated.
make: *
* [execfuse] Error 1

Olivier

@vi
Copy link
Owner

vi commented Jul 25, 2016

What if remove .flag_nullpath_ok = 1,?

jimklimov added a commit to jimklimov/execfuse that referenced this issue Aug 13, 2024
@jimklimov
Copy link
Contributor

jimklimov commented Aug 13, 2024

Poked on a Mac Monterey VM with Homebrew (brew install --cask macfuse@dev) currently at version 4.7.2, needs to be enabled via GUI, see https://formulae.brew.sh/cask/macfuse - and it too complains about some more items:

:; make
cc  -O2 -ggdb -Wall execfuse.c chunked_buffer.c execute_script.c -D_FILE_OFFSET_BITS=64 -I/usr/local/include/fuse -L/usr/local/lib -lfuse -pthread -o execfuse
execfuse.c:69:4: warning: format specifies type 'long *' but the argument has type 'blksize_t *' (aka 'int *') [-Wformat]
                ,&stbuf->st_blksize
                 ^~~~~~~~~~~~~~~~~~
execfuse.c:416:2: warning: 'sem_init' is deprecated [-Wdeprecated-declarations]
        sem_init(&info->sem, 0, 1);
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/semaphore.h:55:42: note: 'sem_init' has been explicitly marked deprecated here
int sem_init(sem_t *, int, unsigned int) __deprecated;
                                         ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:211:40: note: expanded from macro '__deprecated'
#define __deprecated    __attribute__((__deprecated__))
                                       ^
execfuse.c:561:3: warning: 'sem_destroy' is deprecated [-Wdeprecated-declarations]
                sem_destroy(&i->sem);
                ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/semaphore.h:53:26: note: 'sem_destroy' has been explicitly marked deprecated here
int sem_destroy(sem_t *) __deprecated;
                         ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:211:40: note: expanded from macro '__deprecated'
#define __deprecated    __attribute__((__deprecated__))
                                       ^
3 warnings generated.
chunked_buffer.c:3:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
         ^~~~~~~~~~
1 error generated.
execute_script.c:1:10: fatal error: 'malloc.h' file not found
#include <malloc.h>
         ^~~~~~~~~~
1 error generated.
make: *** [execfuse] Error 1

on another run that got a few lines past the fixed warnings, also

execute_script.c:52:2: error: implicitly declaring library function 'sprintf' with type 'int (char *, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
        sprintf(script_path, "%s/%s", directory, script_name);
        ^
execute_script.c:52:2: note: include the header <stdio.h> or explicitly provide a declaration for 'sprintf'

These bits are addressed in my PR #14 now :)

Despite the remaining warnings, the program seems to work for my PoC use-case on that platform too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants