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] |
the patch adds a warning for loops which have zero iterations, e.g.
do i = 1, 0 ! never reached end do
(/ i, i=1,2,-1 /) ! Empty array
The question is whether the warning should be printed always (like currently) or only with -W* (-Wsurprising)? For normal loops there are nearly alway not intended; for array constructors they can be used on purpose to construct zero-sized arrays; I don't think that happens often with real-world code, but some (few) programs could have a lot of those.
Build and tested on x86-64-linux. OK for 4.5?
Yours, Daniel
-- Done: Arc-Bar-Cav-Rog-Sam-Val-Wiz To go: Hea-Kni-Mon-Pri-Ran-Tou
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |