emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#24248: closed ([patch] avoid duplicate definition


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#24248: closed ([patch] avoid duplicate definition of global variable presume_output_tty)
Date: Wed, 17 Aug 2016 05:10:02 +0000

Your message dated Tue, 16 Aug 2016 22:09:18 -0700
with message-id <address@hidden>
and subject line Re: [bug-diffutils] bug#24248: [patch] avoid duplicate 
definition of global variable presume_output_tty
has caused the debbugs.gnu.org bug report #24248,
regarding [patch] avoid duplicate definition of global variable 
presume_output_tty
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
24248: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24248
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [patch] avoid duplicate definition of global variable presume_output_tty Date: Wed, 17 Aug 2016 03:17:52 +0200
Hi,

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.

-- 
Hanno Böck
https://hboeck.de/

mail/jabber: address@hidden
GPG: FE73757FA60E4E21B937579FA5880072BBB51E42

Attachment: diffutils-duplicate-definition-presume_output_tty.patch
Description: Text Data

Attachment: pgpjBAZzPYd7I.pgp
Description: OpenPGP digital signature


--- End Message ---
--- Begin Message --- Subject: Re: [bug-diffutils] bug#24248: [patch] avoid duplicate definition of global variable presume_output_tty Date: Tue, 16 Aug 2016 22:09:18 -0700
On Tue, Aug 16, 2016 at 6:17 PM, Hanno Böck <address@hidden> wrote:
> Hi,
>
> 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.

Good catch. Thank you!
I will look into adding -fno-common when it is accepted.
Here's the patch I expect to push soon:

Attachment: duplicate-defn-of-presume_output_tty.diff
Description: Text document


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]