[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-diffutils] bug#24248: [patch] avoid duplicate definition of global
[bug-diffutils] bug#24248: [patch] avoid duplicate definition of global variable presume_output_tty
Wed, 17 Aug 2016 03:17:52 +0200
The variable presume_output_tty is defined both in the diff.h header
and the file util.c (which includes diff.h).
The diff.h file makes sure that the variable is declared as external
except when it's included by the main program diff.c. But as it's also
declared in util.c we end up having two non-external declarations of it.
Traditionally gcc has allowed this behavior, which is probably the
reason it has not been spottet before, but it's not correct C. One can
get a more strict behavior here by passing -fno-common to the CFLAGS and
LDFLAGS and then linking will fail.
The solution is simple: Remove the superfluous declaration in util.c,
see attached patch. Please apply.
Description: Text Data
Description: OpenPGP digital signature
- [bug-diffutils] bug#24248: [patch] avoid duplicate definition of global variable presume_output_tty,
Hanno Böck <=