comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Ada Core Technologies announces GNATCOM
Date: 2000/04/13
Date: 2000-04-13T00:00:00+00:00	[thread overview]
Message-ID: <8d545k$io$1@nnrp1.deja.com> (raw)
In-Reply-To: 38f52ea8.0@news.pacifier.com

In article <38f52ea8.0@news.pacifier.com>,
  "DuckE" <nospam_steved@pacifier.com> wrote:
> To quote K&R section 6.2:
> "There are a number of restrictions on C structures.  The
essential rules
> are that the only operations that you can perform on a
structure are take
> its address with &, and accesss one of its members.  This
implies that
> structures may not be assigned or copied as a unit, and that
they can not be
> passed to or returned from functions.  (These restrictions
will be removed
> in forthcoming versions.)"

Well yes, of course in the original K&R C you could not pass
struct parameters at all, so the issue does not arise.

> As I recall a number of 'C' compilers considered a structure
to be more like
> an array than like a single variable, so structures were
implicitly passed
> by reference (in the same manner as arrays still are).

I never used a C compiler this broken, although there may have
been some. It is fundamental to the C model of parameter
passing that a called function can modify the parameter without
affecting the caller. Again I wonder if you are remembering
typical C code in which structs are passed by pointer. It is
really QUITE unusual to see C code where structs are passed by
value.

There were several C compilers prior to ANSI that did implement
this extension, and implemented it correctly (gcc was one such
compiler, most certainly no version of gcc has had this serious
bug!)



>
> BTW:  I vote for the Import(Ansi_C,...)  which should solve
the problem more
> easily in new code.
>
> SteveD
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.




  reply	other threads:[~2000-04-13  0:00 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-07  0:00 Ada Core Technologies announces GNATCOM Robert Dewar
2000-04-07  0:00 ` Ted Dennison
2000-04-07  0:00 ` Vladimir Olensky
2000-04-08  0:00   ` Robert Dewar
2000-04-08  0:00 ` tmoran
2000-04-08  0:00   ` David Botton
2000-04-08  0:00   ` Robert Dewar
2000-04-09  0:00     ` tmoran
2000-04-12  0:00       ` Robert Dewar
2000-04-12  0:00         ` C_Pass_By_Value, was " tmoran
2000-04-12  0:00         ` Tarjei T. Jensen
2000-04-12  0:00           ` David Botton
2000-04-12  0:00             ` Robert Dewar
2000-04-12  0:00               ` David Botton
2000-04-12  0:00                 ` Hyman Rosen
2000-04-12  0:00                   ` David Botton
2000-04-13  0:00                     ` Tarjei T. Jensen
2000-04-13  0:00                     ` Robert Dewar
2000-04-14  0:00                       ` Geoff Bull
2000-04-14  0:00                         ` dale
2000-04-13  0:00                 ` Robert Dewar
2000-04-12  0:00               ` DuckE
2000-04-13  0:00                 ` Robert Dewar [this message]
2000-04-12  0:00           ` Robert Dewar
2000-04-12  0:00             ` Robert A Duff
2000-04-13  0:00               ` Robert Dewar
2000-04-13  0:00                 ` Robert A Duff
2000-04-15  0:00                   ` Robert Dewar
2000-04-09  0:00     ` tmoran
2000-04-09  0:00       ` Robert Dewar
2000-04-09  0:00       ` Larry Kilgallen
2000-04-09  0:00         ` Marin D. Condic
2000-04-09  0:00           ` Brian Rogoff
2000-04-09  0:00             ` David Starner
2000-04-10  0:00               ` Gisle S�lensminde
2000-04-10  0:00                 ` Hyman Rosen
2000-04-11  0:00                   ` Gisle S�lensminde
2000-04-11  0:00                     ` Hyman Rosen
2000-04-10  0:00             ` Marin D. Condic
2000-04-09  0:00         ` Robert Dewar
2000-04-09  0:00         ` tmoran
2000-04-09  0:00         ` Robert Dewar
2000-04-11  0:00         ` Tucker Taft
2000-04-08  0:00 ` Tom Hargraves
2000-04-08  0:00   ` David
2000-04-08  0:00   ` Robert Dewar
2000-04-08  0:00   ` David Starner
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox