This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Restriction (No_Streams) forbids stream attributes


This patch adds an explicit test to forbid stream attributes if
restriction No_Streams is active. This was mostly implied by the
prohibition of stream objects, but not entirely because of library
units, and anyway, it is better to have these flagged at compile
time in a clear manner in the unit where they occur.

The following program is an example:

     1. pragma Restrictions (No_Streams);
     2. with Ada.Text_IO; use Ada.Text_IO;
     3. with Ada.Text_IO.Text_Streams;
     4. use  Ada.Text_IO.Text_Streams;
     5. procedure sattr is
     6.    f : File_Type;
     7. begin
     8.    Integer'Write (Stream (f), 3);
           |
        >>> violation of restriction "no_streams" at line 1

     9. end;

Tested on x86_64-pc-linux-gnu, committed on trunk

2009-04-09  Robert Dewar  <dewar@adacore.com>

	* sem_attr.adb (Check_Stream_Attribute): Check violation of
	restriction No_Streams

	* gnat_rm.texi: Clarify No_Streams restriction

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]