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

libdill/fd.c uses dill_ctx_fd without guarding it with DILL_SOCKETS #235

Open
sleeptightAnsiC opened this issue Jan 7, 2025 · 0 comments

Comments

@sleeptightAnsiC
Copy link

Hi,

I attempted to compile libdill without build system
(just cc every source file and link it by hand)
and found out that compilation of libdill/fd.c fails due to:

$ cc fd.c -o fd.o -c ; cc --version ; uname -srm
fd.c: In function ‘dill_fd_allocbuf’:
fd.c:59:43: error: ‘struct dill_ctx’ has no member named ‘fd’
   59 |     struct dill_ctx_fd *ctx = &dill_getctx->fd;
      |                                           ^~
fd.c: In function ‘dill_fd_freebuf’:
fd.c:71:43: error: ‘struct dill_ctx’ has no member named ‘fd’
   71 |     struct dill_ctx_fd *ctx = &dill_getctx->fd;
      |                                           ^~
cc (GCC) 14.2.1 20240910
Linux 6.12.8-arch1-1 x86_64

It's because struct dill_ctx_fd is defined conditionally here:

libdill/ctx.h

Lines 40 to 42 in 32d0e8b

#if defined DILL_SOCKETS
struct dill_ctx_fd fd;
#endif

but its usage in libdill/fd.c is NOT guarder by DILL_SOCKETS

This is of course easy to workaround with $ cc fd.c -c -DDILL_SOCKETS
but I fought it would be nice to report since it's the only issue (with #234 )
preventing libdill from being compiled without it's build system.

For comparison, there is a similar macro DILL_THREADS
which does not need to be defined in order to compile libdill.

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

1 participant