Skip to content

Commit

Permalink
landlock: remove empty functions
Browse files Browse the repository at this point in the history
Functions with `...` as the first parameter appear to be unsupported in
older versions of gcc, as they fail to compile.  Examples:

Error from gcc 9.5.0-1ubuntu1~16.04.sav1 on Ubuntu 16.04:

    [...]
    In file included from appimage.c:23:
    firejail.h:981:27: error: ISO C requires a named argument before ‘...’
      981 | static inline int ll_read(...) { return 0; }
          |                           ^~~

Warning from gcc 13.2.1-3 on Artix Linux:

    $ ./configure --disable-landlock >/dev/null && make clean >/dev/null &&
      make EXTRA_CFLAGS+='-std=c99 -Wpedantic -Wno-error'
    [...]
    gcc -ggdb -O2 -DVERSION='"0.9.73"' -DMOD_DIR='"src/firejail"' [...]
    In file included from appimage.c:23:
    firejail.h:982:27: warning: ISO C requires a named argument before ‘...’ before C2X [-Wpedantic]
      982 | static inline int ll_read(...) { return 0; }
          |                           ^~~

Fixes netblue30#6115.

Relates to netblue30#6078.
  • Loading branch information
kmk3 committed Dec 8, 2023
1 parent 4959c55 commit b02a7a3
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/firejail/firejail.h
Original file line number Diff line number Diff line change
Expand Up @@ -976,16 +976,6 @@ int ll_exec(const char *allowed_path);
int ll_basic_system(void);
int ll_restrict(__u32 flags);
void ll_add_profile(int type, const char *data);
#else
static inline int ll_get_fd(void) { return -1; }
static inline int ll_is_supported(void) { return 0; }
static inline int ll_read(...) { return 0; }
static inline int ll_write(...) { return 0; }
static inline int ll_special(...) { return 0; }
static inline int ll_exec(...) { return 0; }
static inline int ll_basic_system(void) { return 0; }
static inline int ll_restrict(...) { return 0; }
static inline void ll_add_profile(...) { return; }
#endif /* HAVE_LANDLOCK */

#endif

0 comments on commit b02a7a3

Please sign in to comment.