home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.fortran      Putting John Backus on a giant pedestal      5,127 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 4,845 of 5,127   
   Thomas Koenig to Lynn McGuire   
   Re: in gfortran, is it faster compile ti   
   14 Nov 24 06:48:47   
   
   From: tkoenig@netcologne.de   
      
   Lynn McGuire  schrieb:   
   > On 11/12/2024 2:59 PM, Thomas Koenig wrote:   
      
   >> Hm... maybe another point. If you want to find discrepancies in   
   >> argument lists, you could concatenate all your Fortran source files   
   >> into one (which will be large, I presume) and then run "gfortran   
   >> -fsyntax-only" on it.  You could then get error messages like   
   >>   
   >> $ cat mismatch.f   
   >>        subroutine foo(a)   
   >>        real a   
   >>        end   
   >>   
   >>        subroutine bar   
   >>        call foo(42)   
   >>        end   
   >> $ gfortran -fsyntax-only mismatch.f   
   >> mismatch.f:6:72:   
   >>   
   >>      6 |       call foo(42)   
   >>           
                                                                           1   
   >> Error: Type mismatch in argument 'a' at (1); passed INTEGER(4) to REAL(4)   
   >>   
   >> which you could then investigate.   
   >   
   > Yeah, I really do not want to do that as it will be only a special run.   
   > I want the errors to show up during each compile so that the programmer   
   > will fix them right then and there.   
      
   Then modules are your best choice, I think.   
      
   On the other hand, -fsyntax-only is very fast because it does not   
   do code generation at all.  It might be worth a try to see how   
   long it takes on your whole codebase, and if it can be integrated   
   into your normal compilation process.   
      
   > And we had a user run into an unbalanced argument call to a subroutine   
   > on Monday.  One of us had changed a subroutine argument list and fixed 8   
   > out of the 9 calls.  No telling how many of those land mines are sitting   
   > in our software.   
      
   You will find out with -fsyntax-only.  Another possibility is -flto, but   
   then the final "linking" step will take a very long time.  Might speed   
   up things in the resulting executable, though.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca