logo

error-standalone

standalone <error.h> implementation intended for muslgit clone https://anongit.hacktivis.me/git/error-standalone.git/

test-error.c (384B)


  1. // Copyright © 2024 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
  2. // SPDX-License-Identifier: MIT
  3. #define _GNU_SOURCE
  4. #include <errno.h>
  5. #include "error.h"
  6. int
  7. main(void)
  8. {
  9. error(0, 0, "no-format");
  10. error(0, 0, "format: %s", "World");
  11. error(0, EPERM, "format-errno: %s", "World");
  12. error(0, EPERM, "no-format-errno");
  13. error(1, EPERM, "exit-no-format-errno");
  14. return 42;
  15. }