linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: "Martin Liška" <mliska@suse.cz>
Cc: linux-ext4 <linux-ext4@vger.kernel.org>
Subject: Re: PATCH - e2fsprogs - rename static variable link
Date: Tue, 29 Apr 2014 08:24:17 -0700	[thread overview]
Message-ID: <20140429152417.GB17247@birch.djwong.org> (raw)
In-Reply-To: <535F6B36.70401@suse.cz>

On Tue, Apr 29, 2014 at 11:04:54AM +0200, Martin Liška wrote:
> Hello,
>    I've been testing gentoo packages: http://marxin.github.io/blog/2014/04/24/gentoo-linux-packages-with-gcc-4-dot-9-lto/
> and I met few gentoo packages that have conflicting variable with
> compile_et:
> 
> https://github.com/krb5/krb5/issues/106
> 
> I would like to ask you if you can apply attached patch. It's
> suggestion, maybe you will find better variable name.
> 
> Compiles fine for x86_64, test suite passes.

Looks ok to me, but you should add a Signed-off-by: and send to
linux-ext4@vger.kernel.org [cc'd] so Ted can have a look and possibly apply it.
It's sort of surprising that LTO can't deal with a static variable that shadows
a global symbol, but then I haven't looked at LTO.

--D

> 
> Thank you,
> Martin

> diff --git a/lib/et/et_c.awk b/lib/et/et_c.awk
> index 99c33ba..8680279 100644
> --- a/lib/et/et_c.awk
> +++ b/lib/et/et_c.awk
> @@ -238,7 +238,7 @@ END {
>  		tab_base_low, table_item_count) > outfile
>  	}
>  	print "" > outfile
> -	print "static struct et_list link = { 0, 0 };" > outfile
> +	print "static struct et_list link_ = { 0, 0 };" > outfile
>  	print "" > outfile
>  	print "void initialize_" table_name "_error_table_r(struct et_list **list);" > outfile
>  	print "void initialize_" table_name "_error_table(void);" > outfile
> @@ -257,8 +257,8 @@ END {
>  	print "            return;" > outfile
>  	print "    et = malloc(sizeof(struct et_list));" > outfile
>  	print "    if (et == 0) {" > outfile
> -	print "        if (!link.table)" > outfile
> -	print "            et = &link;" > outfile
> +	print "        if (!link_.table)" > outfile
> +	print "            et = &link_;" > outfile
>  	print "        else" > outfile
>  	print "            return;" > outfile
>  	print "    }" > outfile
> diff --git a/lib/et/test_cases/continuation.c b/lib/et/test_cases/continuation.c
> index 1207897..1e17ba4 100644
> --- a/lib/et/test_cases/continuation.c
> +++ b/lib/et/test_cases/continuation.c
> @@ -25,7 +25,7 @@ extern struct et_list *_et_list;
>  
>  const struct error_table et_ovk_error_table = { text, 43787520L, 1 };
>  
> -static struct et_list link = { 0, 0 };
> +static struct et_list link_ = { 0, 0 };
>  
>  void initialize_ovk_error_table_r(struct et_list **list);
>  void initialize_ovk_error_table(void);
> @@ -44,8 +44,8 @@ void initialize_ovk_error_table_r(struct et_list **list)
>              return;
>      et = malloc(sizeof(struct et_list));
>      if (et == 0) {
> -        if (!link.table)
> -            et = &link;
> +        if (!link_.table)
> +            et = &link_;
>          else
>              return;
>      }
> diff --git a/lib/et/test_cases/heimdal.c b/lib/et/test_cases/heimdal.c
> index d9be4ce..192c9bb 100644
> --- a/lib/et/test_cases/heimdal.c
> +++ b/lib/et/test_cases/heimdal.c
> @@ -106,7 +106,7 @@ extern struct et_list *_et_list;
>  
>  const struct error_table et_krb_error_table = { text, 39525376L, 82 };
>  
> -static struct et_list link = { 0, 0 };
> +static struct et_list link_ = { 0, 0 };
>  
>  void initialize_krb_error_table_r(struct et_list **list);
>  void initialize_krb_error_table(void);
> @@ -125,8 +125,8 @@ void initialize_krb_error_table_r(struct et_list **list)
>              return;
>      et = malloc(sizeof(struct et_list));
>      if (et == 0) {
> -        if (!link.table)
> -            et = &link;
> +        if (!link_.table)
> +            et = &link_;
>          else
>              return;
>      }
> diff --git a/lib/et/test_cases/heimdal2.c b/lib/et/test_cases/heimdal2.c
> index a8d4c11..ec5b646 100644
> --- a/lib/et/test_cases/heimdal2.c
> +++ b/lib/et/test_cases/heimdal2.c
> @@ -92,7 +92,7 @@ extern struct et_list *_et_list;
>  
>  const struct error_table et_kadm_error_table = { text, -1783126272L, 68 };
>  
> -static struct et_list link = { 0, 0 };
> +static struct et_list link_ = { 0, 0 };
>  
>  void initialize_kadm_error_table_r(struct et_list **list);
>  void initialize_kadm_error_table(void);
> @@ -111,8 +111,8 @@ void initialize_kadm_error_table_r(struct et_list **list)
>              return;
>      et = malloc(sizeof(struct et_list));
>      if (et == 0) {
> -        if (!link.table)
> -            et = &link;
> +        if (!link_.table)
> +            et = &link_;
>          else
>              return;
>      }
> diff --git a/lib/et/test_cases/heimdal3.c b/lib/et/test_cases/heimdal3.c
> index b8b9b73..4ffbb1b 100644
> --- a/lib/et/test_cases/heimdal3.c
> +++ b/lib/et/test_cases/heimdal3.c
> @@ -26,7 +26,7 @@ extern struct et_list *_et_list;
>  
>  const struct error_table et_h3test_error_table = { text, 43787520L, 2 };
>  
> -static struct et_list link = { 0, 0 };
> +static struct et_list link_ = { 0, 0 };
>  
>  void initialize_h3test_error_table_r(struct et_list **list);
>  void initialize_h3test_error_table(void);
> @@ -45,8 +45,8 @@ void initialize_h3test_error_table_r(struct et_list **list)
>              return;
>      et = malloc(sizeof(struct et_list));
>      if (et == 0) {
> -        if (!link.table)
> -            et = &link;
> +        if (!link_.table)
> +            et = &link_;
>          else
>              return;
>      }
> diff --git a/lib/et/test_cases/imap_err.c b/lib/et/test_cases/imap_err.c
> index 6f576d3..ca5414e 100644
> --- a/lib/et/test_cases/imap_err.c
> +++ b/lib/et/test_cases/imap_err.c
> @@ -54,7 +54,7 @@ extern struct et_list *_et_list;
>  
>  const struct error_table et_imap_error_table = { text, -1904809472L, 30 };
>  
> -static struct et_list link = { 0, 0 };
> +static struct et_list link_ = { 0, 0 };
>  
>  void initialize_imap_error_table_r(struct et_list **list);
>  void initialize_imap_error_table(void);
> @@ -73,8 +73,8 @@ void initialize_imap_error_table_r(struct et_list **list)
>              return;
>      et = malloc(sizeof(struct et_list));
>      if (et == 0) {
> -        if (!link.table)
> -            et = &link;
> +        if (!link_.table)
> +            et = &link_;
>          else
>              return;
>      }
> diff --git a/lib/et/test_cases/simple.c b/lib/et/test_cases/simple.c
> index 10ab1a3..76b64ec 100644
> --- a/lib/et/test_cases/simple.c
> +++ b/lib/et/test_cases/simple.c
> @@ -46,7 +46,7 @@ extern struct et_list *_et_list;
>  
>  const struct error_table et_krb_error_table = { text, 39525376L, 22 };
>  
> -static struct et_list link = { 0, 0 };
> +static struct et_list link_ = { 0, 0 };
>  
>  void initialize_krb_error_table_r(struct et_list **list);
>  void initialize_krb_error_table(void);
> @@ -65,8 +65,8 @@ void initialize_krb_error_table_r(struct et_list **list)
>              return;
>      et = malloc(sizeof(struct et_list));
>      if (et == 0) {
> -        if (!link.table)
> -            et = &link;
> +        if (!link_.table)
> +            et = &link_;
>          else
>              return;
>      }

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

           reply	other threads:[~2014-04-29 15:24 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <535F6B36.70401@suse.cz>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140429152417.GB17247@birch.djwong.org \
    --to=darrick.wong@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=mliska@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).