The version of cpp included with RH 7.0 and the updated cpp-2.96-69.i386.rpm that was just released both exhibit this problem. We use the C preprocessor to process #includes for some fortran code. cpp version 2.96 incorrectly strips spaces out of the resulting file, resulting in fortran code that can not be compiled. This same process has worked properly with cpp from egcs-2.91.66, gcc-2.95.1 and gcc-2.95.2 (not to mention every C preprocessor that has been used for this code from the early 80's). Details are below: The following file (let's call it "temp.c") is processed through cpp with the command line "cpp -DFORTRAN temp.c > temp.f". ----------------------temp.c------------------------------ #ifndef FORTRAN static int dummy; /* prevent ranlib from whining */ #else C C WRTSTD. Write to standard output device if different from terminal. C SUBROUTINE WRTSTD(MSG) CHARACTER*(*) MSG INTEGER LENGTH INTEGER LUN LOGICAL TERMNL CALL GETLUN(LUN) CALL GETSTD(TERMNL) LENGTH = LEN(MSG) IF (.NOT. TERMNL) THEN WRITE(LUN, 100) (MSG(I:I),I=1,LENGTH) ENDIF 100 FORMAT(1X, 131(:,A1)) RETURN END #endif ---------------end of temp.c----------------------- The temp.f file created has all the spaces, except one, removed between the "100" and the "FORMAT" from the line 100 FORMAT(1X, 131(:,A1)) This results in g77 choking on the temp.f file.
cpp can do that, none of the C standards require it to leave the spaces in. Use -traditional preprocessor for Fortran (g77 uses for its include directives traditional preprocessor as well).