All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Help with "warning: 'alias' attribute ignored"
Date: Tue, 11 Mar 2008 16:54:56 -0500	[thread overview]
Message-ID: <47D6FFB0.1070108@freescale.com> (raw)

I'm trying to write code that uses the "pragma weak" feature of gcc to define a
global variable that is used only if it isn't defined somewhere else.  I thought
I had it working, but then I noticed this:

powerpc-linux-gnu-gcc -g  -Os   -fPIC -ffixed-r14 -meabi -D__KERNEL__
-DTEXT_BASE=0xFE000000 -I/temp/u-boot.281/include -fno-builtin -ffreestanding
-nostdinc -isystem
/opt/freescale/usr/local/gcc-4.2.72-eglibc-2.5.72-1/powerpc-linux-gnu/lib/gcc/powerpc-linux-gnu/4.2.1/include
-pipe  -DCONFIG_PPC -D__powerpc__ -DCONFIG_MPC83XX -DCONFIG_E300 -ffixed-r2
-msoft-float -Wall -Wstrict-prototypes -c -o fsl_i2c.o fsl_i2c.c
fsl_i2c.c: In function 'get_fdr':
fsl_i2c.c:72: warning: 'alias' attribute ignored


Here's the code in question, which is in fsl_i2c.c:

#pragma weak fsl_i2c_speed_map = default_fsl_i2c_speed_map

struct fsl_i2c_speed_map default_fsl_i2c_speed_map[] = {
	{0, 0x3F}, {-1, 0x3F}
};

static u8 get_fdr(unsigned int i2c_clk, unsigned int speed)
{
	extern struct fsl_i2c_speed_map fsl_i2c_speed_map[];
	...


Line 72 is the "extern struct fsl..." line.

In a platform-specific file, I have this:

struct fsl_i2c_speed_map fsl_i2c_speed_map[] = {
	{0, 0x20},
	...

What I'm trying to do is to make it so that you don't need to define the
fsl_i2c_speed_map[] array in your platform file.  However, I get the warning
message if fsl_i2c_speed_map[] *is* defined in the platform file.

Am I just doing this wrong, or is there a way to avoid the compiler warning?

-- 
Timur Tabi
Linux kernel developer at Freescale

             reply	other threads:[~2008-03-11 21:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-11 21:54 Timur Tabi [this message]
2008-03-12  6:09 ` [U-Boot-Users] Help with "warning: 'alias' attribute ignored" Jean-Christophe PLAGNIOL-VILLARD

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=47D6FFB0.1070108@freescale.com \
    --to=timur@freescale.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.