From f5c0a1420cd747a568a19797dcadd6e6f10892d8 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sat, 9 Mar 2024 23:41:34 +0100 Subject: [PATCH] Upon a warning on a model issue, ngspice should not bail out, even if strict_error is set, as typically the simulation will run and foreign models often have additional unsupported, but less important parameters. It shall however, exit if the simulation is interrupted due to an error and strict_errorhandling is set. --- src/frontend/inp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/frontend/inp.c b/src/frontend/inp.c index 3a1a22300..d59695a18 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -1447,17 +1447,20 @@ inp_dodeck( else if (dd->linenum_orig == 0) { fprintf(stderr, "Error on line:\n %s\n%s\n", dd->line, dd->error); + if (ft_stricterror) + controlled_exit(EXIT_BAD); have_err = TRUE; return 1; } else { fprintf(stderr, "Error on line %d or its substitute:\n %s\n%s\n", dd->linenum_orig, dd->line, dd->error); + if (ft_stricterror) + controlled_exit(EXIT_BAD); have_err = TRUE; return 1; } - if (ft_stricterror) - controlled_exit(EXIT_BAD); + } else { fprintf(stderr, "%s\n", p); } @@ -1941,6 +1944,8 @@ com_source(wordlist *wl) Infile_Path = ngdirname(firstfile); if (inp_spsource(fp, FALSE, tempfile ? NULL : wl->wl_word, FALSE) != 0) { fprintf(stderr, " Simulation interrupted due to error!\n\n"); + if (ft_stricterror) + controlled_exit(EXIT_FAILURE); } }