public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@transmeta.com>
To: Bernard Dautrevaux <Dautrevaux@microprocess.com>
Cc: Morten Welinder <terra@diku.dk>, <gcc@gcc.gnu.org>
Subject: RE: Big-endian Gcc on Intel IA32
Date: Wed, 19 Dec 2001 13:09:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.33.0112191249060.1050-100000@penguin.transmeta.com> (raw)
In-Reply-To: <17B78BDF120BD411B70100500422FC6309E3E3@IIS000>


On Wed, 19 Dec 2001, Bernard Dautrevaux wrote:
> >
> > (To the person suggesting how to do it in C++ - you _can_ get a subset of
> > this in C by the above "embed in a structure" trick).
>
> Just can't resist comment on this. In fact in C++ you can do a lot more; you
> can also define all the needed and meaningful operators on this type, so
> that you may, for example, add or subtract an int from it, but not add two
> of these or multiply them.

Agreed. And to do the same in C you need to start actually adding
syntactic elements, ie you can't just overload the "+" operator, you have
to manually add "my_add(a,b)".

The basic point I wanted to make was, however, the ease of retrofitting
and tracking (and, potentially fixing) existing code that depends on some
special "attribute". It gets even worse if you have multiple independent
attributes that can potentially be mixed (ie same type of element, but
different restrictions on the element).

It doesn't have to be in the compiler, of course. There are off-line tools
(both free and commercial) to track semantics, eg code viewers etc that
are able to track the flow of data through the system. And maybe that is
fundamentally the right approach.

Having a way of tagging data structures and getting the compiler to check
them statically at compile-time is historically useful, though. That is,
after all, exactly what function prototypes are - a "tag" on the function
that specifies what kinds of arguments it accepts (and one that you cannot
remove without quite explicit casting).

		Linus

  reply	other threads:[~2001-12-19 21:01 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-19 11:47 Bernard Dautrevaux
2001-12-19 13:09 ` Linus Torvalds [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-12-23  7:26 dewar
2001-12-23  7:06 dewar
2001-12-23  7:08 ` Florian Weimer
2001-12-20  5:36 Etienne Lorrain
2001-12-18 11:41 Morten Welinder
2001-12-18 11:42 ` Phil Edwards
2001-12-18 14:48 ` Linus Torvalds
2001-12-18  3:49 dewar
2001-12-23  6:59 ` Florian Weimer
2001-12-17 18:39 dewar
2001-12-17 18:59 ` Per Bothner
2001-12-17 13:14 dewar
2001-12-17 13:42 ` guerby
2001-12-17 13:43 ` Linus Torvalds
2001-12-17 14:22   ` guerby
2001-12-17 14:52     ` Linus Torvalds
2001-12-17 15:01   ` Richard Henderson
2001-12-17 15:12     ` Linus Torvalds
2001-12-17 15:54       ` Richard Henderson
2001-12-17 17:43         ` Linus Torvalds
2001-12-17 18:12           ` Richard Henderson
2001-12-18 11:55       ` Jason Riedy
2001-12-17 16:43   ` Ross Smith
2001-12-18  1:28 ` Florian Weimer
2001-12-17 12:08 dewar
2001-12-17 13:10 ` Linus Torvalds
2001-12-17 14:00   ` Alan Lehotsky
2001-12-17 12:00 Ghanta, Bose

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=Pine.LNX.4.33.0112191249060.1050-100000@penguin.transmeta.com \
    --to=torvalds@transmeta.com \
    --cc=Dautrevaux@microprocess.com \
    --cc=gcc@gcc.gnu.org \
    --cc=terra@diku.dk \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).