As part of CI testing, I'm byte-compiling package files to make sure there are no errors. I'd like to take this a step further and ensure there are no warnings, either (like 'function not known to be defined', etc.).

Is there a variable I can let-bind to make this happen? apropos was not very enlightening.

  • What do you mean exactly by "treat warnings as errors"? Are you asking for a way of having each byte-compiler warning raise an error?
    – Drew
    Commented May 15, 2017 at 4:36
  • @Drew exactly. I want my test to fail if there are any byte-compile warnings. (By the way, I do thing package-development is appropriate here; this is part of the dev process.) Commented May 15, 2017 at 6:15
  • 2
    Sounds like the equivalent of -Werror in contemporary C compilers to me.
    – wasamasa
    Commented May 15, 2017 at 6:51

1 Answer 1


The documentation for the customisable variable byte-compile-error-on-warn says:

If true, the byte-compiler reports warnings with `error'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.