From fd480bd2086c498484e735b060a1c3e80491f02d Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Mon, 9 Oct 2017 12:52:57 +0200 Subject: [PATCH] Mark ocaml_augeas_source w/o aug_source as noreturn If aug_source is not available, the implementation of ocaml_augeas_source just raises Failure: the caml_failwith function used for that is marked as noreturn, and thus with more strict compiler flags it can fail to build. As solution, mark it as noreturn when aug_source is not available. --- augeas-c.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/augeas-c.c b/augeas-c.c index 64fe99b..09d3add 100644 --- a/augeas-c.c +++ b/augeas-c.c @@ -29,6 +29,12 @@ #include #include +#ifdef __GNUC__ + #define NORETURN __attribute__ ((noreturn)) +#else + #define NORETURN +#endif + extern CAMLprim value ocaml_augeas_create (value rootv, value loadpathv, value flagsv); extern CAMLprim value ocaml_augeas_close (value tv); extern CAMLprim value ocaml_augeas_get (value tv, value pathv); @@ -41,7 +47,11 @@ extern CAMLprim value ocaml_augeas_save (value tv); extern CAMLprim value ocaml_augeas_load (value tv); extern CAMLprim value ocaml_augeas_set (value tv, value pathv, value valuev); extern CAMLprim value ocaml_augeas_transform (value tv, value lensv, value filev, value modev); -extern CAMLprim value ocaml_augeas_source (value tv, value pathv); +extern CAMLprim value ocaml_augeas_source (value tv, value pathv) +#ifndef HAVE_AUG_SOURCE + NORETURN +#endif +; typedef augeas *augeas_t; -- 1.8.3.1