public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* How can I get the BSS emitted at the start of the file instead of the end of the file?
@ 2002-09-07 23:49 Mike Laman
  2002-09-08 10:58 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Laman @ 2002-09-07 23:49 UTC (permalink / raw)
  To: GCC

Hi,

Despite all my efforts, I can't seem to get GCC to output the common
(uninitialized) data
space allocation at the beginning of the file as it does for the initialized
data instead of at
the end of the file.

I must be missing something simple here. Anyone else have this difficulty?

Thanks,
Mike

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How can I get the BSS emitted at the start of the file instead of the end of the file?
  2002-09-07 23:49 How can I get the BSS emitted at the start of the file instead of the end of the file? Mike Laman
@ 2002-09-08 10:58 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2002-09-08 10:58 UTC (permalink / raw)
  To: Mike Laman; +Cc: GCC

On Sat, Sep 07, 2002 at 11:50:15PM -0700, Mike Laman wrote:
> Despite all my efforts, I can't seem to get GCC to output the common
> (uninitialized) data space allocation at the beginning of the file as
> it does for the initialized data instead of at the end of the file.

This is a feature.

6.9.2  External object definitions

2    A declaration of an identifier for an object that has file scope
     without an initializer, and without a storage-class specifier or
     with the storage-class specifier static, constitutes a /tentative
     definition/. If a translation unit contains one or more tentative
     definitions for an identifier, and the translation unit contains
     no external definition for that identifier, then the behavior is
     exactly as if the translation unit contains a file scope declaration
     of that identifier, with the composite type as of the end of the
     translation unit, with an initializer equal to 0.

Notice that we have to wait until the end of the translation unit
to find out if there are no external definitions.


r~

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-08 17:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-07 23:49 How can I get the BSS emitted at the start of the file instead of the end of the file? Mike Laman
2002-09-08 10:58 ` Richard Henderson

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 read-only IMAP folder(s) and NNTP newsgroup(s).