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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,d87fe6752812f07a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!cyclone1.gnilink.net!gnilink.net!wn11feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: GNAT on WinXP: System.OS_Lib.Spawn raises Program_Error Reply-To: anon@anon.org (anon) References: <50d832b4-140d-4029-8d7c-9397115160ba@u8g2000yqn.googlegroups.com> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Mon, 04 May 2009 00:22:14 GMT NNTP-Posting-Host: 12.65.6.220 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1241396534 12.65.6.220 (Mon, 04 May 2009 00:22:14 GMT) NNTP-Posting-Date: Mon, 04 May 2009 00:22:14 GMT Organization: AT&T Worldnet Xref: g2news2.google.com comp.lang.ada:5669 Date: 2009-05-04T00:22:14+00:00 List-Id: General comments should be taken with a gain of salt. If you check, most of the GNAT packages and programs, you will see 100s of comments that are not valid or useful. Like, "Is this correct" or "need comment here". Then other places where comments could be useful there is only code. What is needed is another documentation file, called may be "GNAT extension to Ada 2005 specification", where the documentation would explain the extra packages with each package routine, and including the package limitations, if any. The following example show that the "System.OS.LIB" could be set as a non-portable internal system file that generates warning and forces a programmer to use "GNAT.OS_LIB". But in Ada 2005 version, Adacore decided not too. Which allows the programmer to choose to use "GNAT.OS_LIB" (Ada 95 specs) or "System.OS_LIB" (Ada 2005 specs). Just like some programmers choose to use "Text_IO" instead of "Ada.Text_IO", or "Unchecked_Conversion" instead of "Ada.Unchecked_Conversion". The following two/three files will show how to bypass the non-portable error. We all know that the attribute Image is an internal routine and if you include those files that contains those routine the compiler will generate a non-portable compiler warning. But if you rename those system files you can access those routines with no generated warnings after compiling the renaming file. -- compiler order gnat compile Img_Bool gnat make test1 -- -- Test1.ads -- with Ada.Text_IO ; use Ada.Text_IO ; -- System file that defines Image routine for Boolean -- "Image" attribute and will give a non-portable -- warning message, if use -- with System.Img_Bool ; -- use System.Img_Bool ; -- package that refined system file System.Img_Bool -- No warning or error message, if pre-compiled -- version is used. with Img_Bool ; use Img_Bool ; procedure test1 is Success : Boolean := True ; begin -- test1 Put ( "Image Value of 'Success' := " ) ; Put ( Image_Boolean ( Success ) ) ; New_Line ( 2 ) ; Put_Line ( "Built-in Image Value of 'Success' := " & Boolean'Image ( Success ) ) ; end test1 ; -- -- Img_Bool.ads : Rename internal GNAT package "System.Img_Bool" -- Compiling this file like most packages that include -- GNAT internal system files will generate a warning. -- With or without the body file. -- -- Using this file after it has been compiled will -- prevent the compiler from generating a non-portable -- warning message and gives direct access to a GNAT -- internal system file routine. -- with System.Img_Bool ; package Img_Bool renames System.Img_Bool ; -- -- Img_Bool.adb : Not really needed. Used just to match the -- design of "GNAT.OS_LIB", under Ada 2005. -- -- Do not use, if compiling pre GNAT 2005. -- pragma No_Body ; In , "Ed Falis" writes: >On Sat, 02 May 2009 19:20:05 -0400, anon wrote: > >> Ed. >> >> If that was correct, then using "System.OS_LIB" would generated a >> compiler WARNING, but no error or warning is given. So, that package >> is usable as is. > >Ah, I see. The unit does not get a warning because its interface is >"fixed" for use by the renaming. Still, the current header comments >contain: > >-- Note: this package is in the System hierarchy so that it can be >directly >-- be used by other predefined packages. User access to this package is >via >-- a renaming of this package in GNAT.OS_Lib (file g-os_lib.ads).