http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59065
Harald Anlauf <anlauf at gmx dot de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |anlauf at gmx dot de
--- Comment #6 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Vittorio Zecca from comment #5)
> I do not think SIZE should be used to detect an undefined array
> pointer, but a size of zero
> warns the code that the array is mostly unusable and that perhaps
> something is wrong,
> while a nonzero size is telling the program it is fine to use the array.
No. As Steve pointed out in comment #3, a zero sized array is perfectly fine.
IMO that was a good choice in Fortran, so one does not have to special-case
these when writing code. Your opinion may differ.
Please also have a look at the Fortran standard, e.g.
13.7.156 SIZE (ARRAY [, DIM, KIND])
Description. Size of an array or one extent.
Class. Inquiry function.
Arguments.
ARRAY shall be an array of any type. It shall not be an unallocated
allocatable variable or a pointer that
is not associated. ...
> I agree with Dominique, I am still writing invalid code all the time,
> also because interactive
> computing makes it so easy and fast to write, compile, link and execute code.
> When I used punched cards in the seventies I had more time to think
> and reflect about my
> programs, also because the turnaround time was about 30 minutes as compared
> with 30 seconds today
> If the programmers did not write invalid code many people would be out
> of business:-)
Or they would be more productive...