Dear Harald, On 10.03.21 20:43, Harald Anlauf wrote:
In the following variant of the program, the invalid variable declaration of 'c' itself is avoided by using a block:integer :: ll ll = 4 block character(ll) :: c(2), cc(2) character(ll) :: c2(2), cc2(2) data c /'a', 'b'/ data c2(:)(1:1) /'a', 'b'/ common /block/ cc, cc2 end block endNo, this example is invalid
Of course this example is invalid – I only wrote that it avoids the issues with the declaration of 'C' itself not that the code as a whole is valid. Regarding:
C1107(R1107) A block-specification-part shall not contain a COMMON, EQUIVALENCE, INTENT, NAMELIST, OPTIONAL, statement function, or VALUE statement.
That could be mended by removing the 'common' line. Especially as I forgot to actually use 'cc'/'cc2' in a data statement ... Or by using a host-associated 'll' instead of a block. But that still will have the automatic issue for common, hence, removing common is probably best. One the other hand: In any case, there are hundreds of ways to write invalid code – chose one you like for the testcase :-) Thanks for this patch – and all the belated patch work! Tobias ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank Thürauf
