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] |
If nested loops appear where the iteration ranges are over the same range of a multi-dimensional range (where the range number has been defaulted to 1), then a warning is issued as shown in the following example: 1. procedure Warn2D is 2. type E is array (Integer range <>, Integer range <>) 3. of Integer; 4. S : Integer := 0; 5. EE : E (1 .. 3, 1 .. 3) := (Others => (Others => 0)); 6. begin 7. for J in EE'Range loop 8. for K in EE'Range loop | >>> warning: inner range same as outer range at line 7 9. S := S + EE (J, K); 10. end loop; 11. end loop; 12. end Warn2D; Tested on x86_64-pc-linux-gnu, committed on trunk 2012-10-29 Robert Dewar <dewar@adacore.com> * sem_ch5.adb (Analyze_Loop_Statement): Add warning for identical inner/outer ranges.
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] |