f90getopt icon indicating copy to clipboard operation
f90getopt copied to clipboard

ifort issue with getopt-string

Open haniibrahim opened this issue 3 years ago • 2 comments

          some thing very interesting:

using ifort on windows, it will stop after paring the first option using the example

however, it runs fine, if you change the sample by calling the function outside the case selection. gfortran does not have this issue.

    do
        a = getopt("ab:h", opts)
        select case(a)
            case(char(0)) ! When all options are processed
                exit
            case("a")
                print*, "option alpha/a"
            case("b")
                print*, "option beta/b=",  trim(optarg) ! "trim" is quite useful to avoid trailing blanks
            case("h")
                print*, "help-screen"
        end select
    end do

Originally posted by @ougx in https://github.com/haniibrahim/f90getopt/issues/4#issuecomment-1474117887

haniibrahim avatar Mar 17 '23 20:03 haniibrahim

Thank you for reporting this issue. I will change the doc for ifort compatibility

haniibrahim avatar Mar 17 '23 20:03 haniibrahim

Issue fixed in current commit.

haniibrahim avatar Mar 17 '23 20:03 haniibrahim