From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,751584f55705ddb7 X-Google-Attributes: gid103376,public From: Ken & Virginia Garlington Subject: Re: Ada is almost useless in embedded systems Date: 1996/02/17 Message-ID: <312609D9.4E6F@flash.net>#1/1 X-Deja-AN: 139849337 references: <823906039.22113@assen.demon.co.uk> <823965654.4500@assen.demon.co.uk> <824165619.14894@assen.demon.co.uk> <824332550.2485@assen.demon.co.uk> content-type: text/plain; charset=us-ascii organization: Redhawk Kennels mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (Macintosh; I; 68K) Date: 1996-02-17T00:00:00+00:00 List-Id: John McCabe wrote: > That's all very well, but if you are _not_ using tasking, and your > compiler knows this (which it obviously should), then this implies > that this pragma is redundant - no tasks = no shared objects. Actually, one of the things that's easy to forget in Ada is that you are _always_ using tasking. The main program is just another task. Another issue is that the compiler may _not_ know you are using tasking when it encounters the pragma, since the task referencing the object may not have been compiled yet. So, I suspect that many Ada compilers don't do the optimization you're assuming. > What pragma shared is _not_ is a directive to enforce no optimisation > of an object. On the other hand, this is exactly what the C volatile > qualifier is. There is a distinction between shared and volatile, which is why some Ada 83 vendors (e.g. DEC Ada) added it as an extra pragma, and why it is now part of the Ada standard.