Skip to content

string length errors from SPEAR runs  #136

Closed
@rem1776

Description

SPEAR errors have been reported due to a string length being exceeded in the code below:

CHARACTER(len=256) :: executable_name, arg, fredb_id
#ifdef FREDB_ID
#define xstr(s) str(s)
#define str(s) #s
fredb_id = xstr(FREDB_ID)
#else
#warning "FREDB_ID not defined. Continuing as normal."
fredb_id = 'FREDB_ID was not defined (e.g. -DFREDB_ID=...) during preprocessing'
#endif
arg_count = command_argument_count()
DO i=0, arg_count
CALL get_command_argument(i, arg, status=status)
if (status .ne. 0) then
write (error_unit,*) 'get_command_argument failed: status = ', status, ' arg = ', i
stop 1
end if
if (i .eq. 0) then
executable_name = arg
else if (arg == '--fredb_id') then
write (output_unit,*) TRIM(fredb_id)
stop
end if
END DO
if (arg_count .ge. 1) then
write (error_unit,*) 'Usage: '//TRIM(executable_name)//' [--fredb_id]'
stop 1
end if

This code related to the fredb is unused and can be removed.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions