Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

string length errors from SPEAR runs #136

Closed
rem1776 opened this issue Jul 11, 2024 · 1 comment
Closed

string length errors from SPEAR runs #136

rem1776 opened this issue Jul 11, 2024 · 1 comment

Comments

@rem1776
Copy link
Contributor

rem1776 commented Jul 11, 2024

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.

@rem1776
Copy link
Contributor Author

rem1776 commented Aug 9, 2024

fixed by #137

@rem1776 rem1776 closed this as completed Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant