comp.lang.ada
 help / color / mirror / Atom feed
From: Erlo Haugen <_elh_@_terma_._com_>
Subject: Re: C's trikery semantic opens up backdoor in new Linux kernel
Date: Fri, 14 Nov 2003 09:33:18 +0100
Date: 2003-11-14T09:33:18+01:00	[thread overview]
Message-ID: <20031114093318.000065b0._elh_@_terma_._com_> (raw)
In-Reply-To: tkr7rvsch7eap70k2jummg4vqf80rposfg@4ax.com

On Fri, 14 Nov 2003 10:04:02 +1300
Craig Carey <research@ijs.co.nz> wrote:

> On Wed, 12 Nov 2003 15:09:52 +0100, Vinzent 'Gadget' Hoefler wrote:
> ...
> >Duncan Sands wrote:
> ...
> >>> constant value you should always state the constant first:
> >>> |if ((__WCLONE|__WALL) == options) && (0 = current->uid))
> >>>
> >>> wouldn't compile, either.
> 
> ...
> >No. And you? Do you really think that the linux kernel community would
> >like the idea of using a *function* to get/set a plain simple integer
> >variable? I already hear them scream: "It would be too inefficient.
> >Especially in a *kernel*!" ;-)
> 
> Ada 95 could be enhanced so that specified record fields could be
> read-only. Some one could perhaps produce data showing that it is needed
> or else it may not appear.
> 
> De-referenced pointers can identify read-only data
>   "type Ptr is access constant X;".
> Then Ada 95 lacks a limited pointer type, and also a pointer that can
> be assigned but which lacks a "=" equality operator.
> 
> 
> 
> 

Isn't this a matter of optmization? If all the function does is assigning a
value, then the compiler could convert it an inline assignment:

My_Variable : something;
function Get_A return something is
begin
  return My_Variable;
end Get_A;



then (possibly in another package)

.
.
.
This_Variable := Other_Package.Get_A;
.
.

could be optimized (in the object code)to

.
.
.
This_Variable := Other_Package.My_Variable;
.
.
.



Just a thought, I don't know much about compiler construction, but it seems to
me to be a way to go.

-- 
Erlo
Remove the underscores
Sorry, I don't have time for this. I've got bugs to write.



  parent reply	other threads:[~2003-11-14  8:33 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-12  3:17 C's trikery semantic opens up backdoor in new Linux kernel Adrian Hoe
2003-11-12  4:26 ` Stephane Richard
2003-11-12  5:13   ` J Cusick
2003-11-12  7:18     ` Vinzent 'Gadget' Hoefler
2003-11-12  7:50       ` Duncan Sands
2003-11-12 12:08         ` Vinzent 'Gadget' Hoefler
2003-11-12 13:38           ` Duncan Sands
2003-11-12 14:09             ` Vinzent 'Gadget' Hoefler
2003-11-13 21:04               ` Craig Carey
2003-11-14  6:45                 ` Freejack
2003-11-14  8:33                 ` Erlo Haugen [this message]
2003-11-14  9:44                   ` Vinzent 'Gadget' Hoefler
2003-11-14 10:16                     ` Dmitry A. Kazakov
2003-11-25 10:06                       ` Craig Carey
2003-11-25 11:20                         ` Dmitry A. Kazakov
2003-11-14 15:31                 ` Robert I. Eachus
2003-11-14 13:12               ` Georg Bauhaus
2003-11-14 13:31                 ` Duncan Sands
2003-11-14 14:56                 ` Vinzent 'Gadget' Hoefler
2003-11-14 15:08                   ` Georg Bauhaus
2003-11-14 15:38                     ` Duncan Sands
2003-11-14 17:57                       ` Georg Bauhaus
2003-11-14 15:47               ` Robert I. Eachus
2003-11-14 16:38                 ` Vinzent 'Gadget' Hoefler
2003-11-19  4:13             ` Dave Thompson
2003-11-21 15:34               ` Martin Krischik
2003-11-23  2:20                 ` Hyman Rosen
2003-11-27  4:22                 ` Dave Thompson
2003-11-28 14:01                   ` Hyman Rosen
2003-11-12 17:37       ` tmoran
2003-11-12 18:03       ` Warren W. Gay VE3WWG
2003-11-12  8:51     ` Adrian Hoe
2003-11-12 12:32       ` Preben Randhol
2003-11-13  5:50         ` Chad R. Meiners
2003-11-12 22:59       ` Wes Groleau
2003-11-14  3:31         ` Adrian Hoe
2003-11-14 11:00           ` Dmytry Lavrov
2003-11-15  5:00             ` Adrian Hoe
2003-11-15  5:02             ` Adrian Hoe
2003-11-16 11:29               ` Dmytry Lavrov
2003-11-17 17:07                 ` Warren W. Gay VE3WWG
2003-11-16 11:35             ` Dmytry Lavrov
2003-11-15 19:30           ` Wes Groleau
2003-11-12  8:52   ` Adrian Hoe
replies disabled

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