Browse Source

Fix building with GCC 10 (#20)

When trying to build with gcc 10, there is a linker error:

    /usr/bin/ld: /tmp/ccjRQbpX.o:/builddir/build/BUILD/entr-4.4/data.h:33: multiple definition of `files'; /tmp/ccHpowMW.o:/builddir/build/BUILD/entr-4.4/missing/../data.h:33: first defined here
    collect2: error: ld returned 1 exit status

This is a known thing in gcc 10:

https://gcc.gnu.org/gcc-10/porting_to.html#common

This patch adds extern keyword to the header file and removes it from
exactly one source file.
pull/24/head
Lubomír Sedlář 1 year ago
committed by Eric Radman
parent
commit
336a83d84f
  1. 4
      data.h
  2. 2
      entr.c

4
data.h

@ -29,5 +29,5 @@ typedef struct {
ino_t ino;
} WatchFile;
/* declare as extern in source */
WatchFile **files;
/* defined in entr.c */
extern WatchFile **files;

2
entr.c

@ -69,7 +69,7 @@ int (*xtcsetattr)(int fd, int action, const struct termios *tp);
/* globals */
extern int optind;
extern WatchFile **files;
WatchFile **files;
WatchFile *leading_edge;
int child_pid;

Loading…
Cancel
Save