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] |
This patch improves on the diagnostic of protected objects that have non- static components and that are therefore illegal under the Ravenscar profile. Previously the full declaration was flagged. Now the offending component (s) are indicated. The message is an error for a single protected object, and a warning for a protected type declaration. Compiling prot.adb now yields the following output:, prot.adb:5:04: violation of restriction "No_Implicit_Heap_Allocations" prot.adb:5:04: from profile "Ravenscar" at gnat.adc:1 prot.ads:10:06: warning: component has non-static size prot.ads:10:06: warning: creation of protected object of type "Lock" will violate restriction No_Implicit_Heap_Allocationss prot.ads:11:06: warning: component has non-static size prot.ads:11:06: warning: creation of protected object of type "Lock" will violate restriction No_Implicit_Heap_Allocationss --- package Prot is Max_Size: integer := 10; type Obj is record Name : String (1 .. Max_Size); end record; protected type Lock is procedure Grab; private Name1 : String (1 .. Max_Size); Name2 : Obj; end Lock; procedure Wrapper; end Prot; --- package body Prot is protected body Lock is procedure Grab is begin null; end; end Lock; It : Lock; procedure Wrapper is begin It.Grab; end Wrapper; end Prot; Tested on x86_64-pc-linux-gnu, committed on trunk 2009-08-07 Ed Schonberg <schonberg@adacore.com> * exp_ch9.adb (Expand_N_Protected_Type_Declaration): In Ravenscar mode, detect non-static private components that will violate restriction No_Implicit_Heap_Allocation.
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] |