0

I realized right now that chktex has return code 0 only if not even a warning is displayed. With warnings seems to be 2. What about other return codes? 1 for instance? The documentation keeps this secret.

  • The code does

    `* Count how warnings or errors we've found, and

    • update the return code with the worst. */

    switch (LaTeXMsgs[Error].Type)

    case etWarn: WarnPrint++; FoundErr = max(FoundErr, EXIT_WARNINGS); break; case etErr: ErrPrint++; FoundErr = max(FoundErr, EXIT_ERRORS); break; case etMsg: break;

    ...

    ret = FindErr(ReadBuffer, CurStkLine(&InputStack)); if ( ret != EXIT_SUCCESS ) { retval = ret; ... return retval; `

    so it looks like the exit code is a warning count, but I get 2 or 0 in all cases

    – David Carlisle Jun 09 '23 at 18:38
  • Ah thank you for pointing.. FindErrs.c in https://git.savannah.gnu.org/git/chktex.git. I am not enough into C to find out whats going on in detail. So 2 means: at least one error or warning. 1 does not occur and 0 means all ok. At least that is a conjecture. – user2609605 Jun 09 '23 at 19:03
  • some reverse engineering seems to show: 1: error in operation, e.g. invalid option 3: error found but not case 1; error ist warning declared as error via -e 2: warning found but either case 1 nor case 2. 0: neither of the cases above, i.e. operation ok, neither error nor warning found. – user2609605 Jun 12 '23 at 21:30

0 Answers0