fpt and WinFPT Reference Manual - Command-line Commands
| SimCon Home | Ref Manual Home |
KEEP NAMES
Syntax:
KEEP NAME [:][:] <name> KEEP NAMES [:][:] <name> [,] <name> ...
Function:
Protects the specified names from modification by the commands OBFUSCATE, HIDE NAMES, OBFUSCATE ONLY and EDIT SYMBOL NAMES.
fpt Version
This command is implemented in fpt versions 4.308 and later.
Where to Use this Command
Operating system command line | Yes |
Configuration file, config.fsp | Yes |
Specification (fsp) files, *.fsp | Yes |
Interactively, to FPT> prompt | No |
Interactive command files | No |
Embedded in the Fortran code | Yes |
Default
Fortran keywords, intrinsic function names and standard operators are always protected. No other names are protected by default.
Example
The test program t_keep_names.f90:
PROGRAM t_keep_names INTEGER*4 :: k1 = 1,c1 = 1,k2 = 2,c2 = 2,k3 = 3,c3 = 3 WRITE(*,*)k1,c1,k2,c2,k3,c3 ! The following will generate an error only if SSA is completed IF (k3) THEN WRITE(*,'("INTEGER k3 used as LOGICAL")') ENDIF ! Check that .AND., .OR. and intrinsics are not obfuscated IF ((k2 .GT. k1) .AND. (k2 .LT. k3)) THEN WRITE(*,'("k1 < k2 < k3")') ENDIF IF ((MAX(k1,k2) .LT. k3) .OR. & (.NOT. (k1 .GE. k2))) THEN WRITE(*,'(".NOT. works as well")') ENDIF END PROGRAM t_keep_names ! ***************************************************************
is processed using the fsp script:
! t_keep_names_only.fsp 1-Feb-25 John Collins % primary input file name extension: ".f90" FPTMAIN:free_format.fsp % keep name: k1 % keep names: k2,k3 % overwrite changed files % correct use of integer for logical % obfuscate only % edit output file names: replace "names" by "names_only" FPTTESTS:t_keep_names.f90 ! End of t_keep_names_only.fsp
and generates:
PROGRAM aabjed INTEGER*4 :: k1 = 1,aabjeg = 1,k2 = 2,aabjei = 2,k3 = 3,aabjfa = 3 WRITE (*,*)k1,aabjeg,k2,aabjei,k3,aabjfa IF (k3) THEN WRITE (*,'("INTEGER k3 used as LOGICAL")') ENDIF IF ((k2 .GT. k1) .AND. & (k2 .LT. k3)) THEN WRITE (*,'("k1 < k2 < k3")') ENDIF IF ((MAX(k1,k2) .LT. k3) .OR. & (.NOT. (k1 .GE. k2))) THEN WRITE (*,'(".NOT. works as well")') ENDIF END PROGRAM aabjed
Copyright ©1995 to 2025 Software Validation Ltd. All rights reserved.