Question about structures,intent(in),pointer elements

Rimvydas Jasinskas rimvydasjas@gmail.com
Sun Feb 2 09:43:00 GMT 2014


> So you don't want to be able to change the value of your argument but
> you want to be able to deallocate/retarget it?
> I don't think it's possible; at least it would go against the principle
> of INTENT(IN) which tells: this value doesn't change.

No, that would be pointless. I want to get more diagnostics.
Code is not mine and it is written by c thinking windows developers...
I just there to bugfix and make it portable to linux.
Basically re factoring and adding intents,diagnostics.
gfortran 4.8.x was very helpful so far.
Attach very simplified full example.
While it should be technically legal under f2003, yet in most cases
this is becomes a bug in code.

So again questions:
1) should code be legal with -std=f95?
2) more like feature request, is it useful to add warning for
definition context with intent(in) under -Wsurprising?
"Warning: Dummy argument 'bar' with INTENT(IN) in variable definition
context (assignment) at (1)"

I could prepare some patches if someone point me where to start
looking in gfortran tree.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_intent4.f03
Type: application/octet-stream
Size: 1073 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140202/3a032021/attachment.obj>


More information about the Fortran mailing list