From: Russell King <rmk@arm.linux.org.uk>
To: Andrew Morton <akpm@zip.com.au>
Cc: "H . J . Lu" <hjl@lucon.org>, Momchil Velikov <velco@fadata.bg>,
Oliver Xymoron <oxymoron@waste.org>,
vda <vda@port.imtp.ilyichevsk.odessa.ua>,
linux-kernel@vger.kernel.org
Subject: Re: Extern variables in *.c files
Date: Thu, 3 Jan 2002 09:57:42 +0000 [thread overview]
Message-ID: <20020103095742.A11443@flint.arm.linux.org.uk> (raw)
In-Reply-To: <02010216180403.01928@manta> <Pine.LNX.4.43.0201021322120.30079-100000@waste.org> <3C337EF1.4C7C72AB@zip.com.au>, <3C337EF1.4C7C72AB@zip.com.au> <87ell8wgo9.fsf@fadata.bg> <3C340601.E9A3507F@zip.com.au>, <3C340601.E9A3507F@zip.com.au>; <20020102234226.A23580@lucon.org> <3C340EA9.FE084B4C@zip.com.au>
In-Reply-To: <3C340EA9.FE084B4C@zip.com.au>; from akpm@zip.com.au on Wed, Jan 02, 2002 at 11:56:25PM -0800
On Wed, Jan 02, 2002 at 11:56:25PM -0800, Andrew Morton wrote:
> Oh well. Seems that disabling -fno-common and enabling
> --warn-common is the only way to autodetect bugs such as this.
You open another can of worms with variables in drivers that should be
static that aren't - you end up with no way to detect these without
-fno-common.
So, you have a choice:
1. Enable -fno-common
- detect variables that should be marked static which aren't
- don't detect size differences
2. Disable -fno-common
- don't detect variables that should be marked static
- detect size differences as long as the variables aren't marked extern
As soon as someone has int foo in one file, and extern char foo in another,
you've lost no matter which option you take.
The header file approach is the most reliable (and imho correct) method to
solve this problem.
--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html
next prev parent reply other threads:[~2002-01-03 9:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-02 18:18 Extern variables in *.c files vda
2002-01-02 19:24 ` Oliver Xymoron
2002-01-02 21:43 ` Andrew Morton
2002-01-02 22:07 ` Momchil Velikov
2002-01-03 7:19 ` Andrew Morton
2002-01-03 7:42 ` H . J . Lu
2002-01-03 7:56 ` Andrew Morton
2002-01-03 8:24 ` Keith Owens
2002-01-03 9:57 ` Russell King [this message]
2002-01-04 0:28 ` Extern variables in *.c files (maintainers pls read this) vda
2002-01-03 23:14 ` Olaf Dietsche
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=20020103095742.A11443@flint.arm.linux.org.uk \
--to=rmk@arm.linux.org.uk \
--cc=akpm@zip.com.au \
--cc=hjl@lucon.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oxymoron@waste.org \
--cc=vda@port.imtp.ilyichevsk.odessa.ua \
--cc=velco@fadata.bg \
/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