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 reverts a previous change that included comparison operators in the No_Direct_Boolean_Operators restriction, but on reflection, this is wrong, and we should fix the documentation rather than the coce. So this patch reverts the previous change and leaves the implementation of this restriction including only logical operators (or/and/xor). The documentation is fixed accordingly. The following shows the patch in action: 1. pragma Restrictions (No_Direct_Boolean_Operators); 2. procedure NDBO (A, B : in out Boolean) is 3. type R is new Boolean; 4. C, D, E : R := R (A); 5. begin 6. C := R (D = E); 7. C := D or E; | >>> violation of restriction "NO_DIRECT_BOOLEAN_OPERATORS" at line 1 8. C := D xor E; | >>> violation of restriction "NO_DIRECT_BOOLEAN_OPERATORS" at line 1 9. A := A or B; | >>> violation of restriction "NO_DIRECT_BOOLEAN_OPERATORS" at line 1 10. A := A > B; 11. end; Prior to this patch lines 6 and 10 were also flagged Tested on x86_64-pc-linux-gnu, committed on trunk 2009-07-20 Robert Dewar <dewar@adacore.com> * sem_res.adb (Check_No_Direct_Boolean_Operators): Remove handling of comparisons. (Resolve_Comparison_Operators): Remove No_Direct_Boolean_Operators check (Resolve_Equality_Op): Remove No_Direct_Boolean_Operators check * gnat_rm.texi: Restriction No_Direct_Boolean_Operators includes only logical operators (AND/OR/XOR), not comparison operators.
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] |