Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343798 - Fortran 2008 'newunit=' specifier not recognized
Summary: Fortran 2008 'newunit=' specifier not recognized
Status: CLOSED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: Photran.Parser (show other bugs)
Version: 8.0.5   Edit
Hardware: PC Linux
: P2 major (vote)
Target Milestone: 8.2   Edit
Assignee: Jeffrey Overbey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-26 04:04 EDT by Daniel Harenberg CLA
Modified: 2014-05-20 02:29 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Harenberg CLA 2011-04-26 04:04:15 EDT
I don't know whether Fortran 2008 features are already on the agenda, but here is one small and handy feature that is not yet recognized.

open(file='whatever.txt', newunit=iounit, action='read') 

gives the error message that would be correct pre-Fortran-2008:

'mod_params.f90 contains syntax errors and may not be refactored correctly.'

The new specifier newunit=iounit (here with integer :: iounit declaration) can be used instead of unit=iounit. It assigns a unique negative number to the unit, which (being negative) can't conflict with system-reserved unit numbers (like standard out) or other user-supplied unit numbers, since all those can only be positive.
Comment 1 Samuel Debionne CLA 2012-12-20 11:50:26 EST
I second this : newunit is definitelly a small but handy feature supported by gfortran and ifort for some time now.
Photran 8.03 / Windows 64.
Comment 2 Daniel Harenberg CLA 2013-07-16 07:12:04 EDT
I am upgrading the importance to major (P2), because this seriously limits the usability for anybody, and should be easy to fix. 

Also, updating Version number, because Photran 8.05 is still affected.

The newunit specifier is supported by gfortran since version 4.5 (released April 2010), and by Intel Fortran since verion 12.0 (released November 2010). Probably also by all others.
Comment 3 Chuck S CLA 2013-12-10 19:36:53 EST
Hi all,

I would also like to see this fix. Is there any way to speed this up?
Comment 4 Jeffrey Overbey CLA 2014-05-20 02:29:38 EDT
Thanks for the feedback.  This is fixed for Photran 8.2 (Luna).

Commit cffda72e06e7c762170dc1bf465b8788d1ca4e47