From 394a47dfc6a3a62410b235dd314ab7f414752668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Thu, 2 Jul 2020 09:37:10 +0200 Subject: [PATCH] Mark new macros change as potentially breaking If an OCaml C library already defines some of the new `Val_none`, `Some_val`, `Is_none`, `Is_some`, `caml_alloc_some`, or `Tag_some` macros; then the C compiler will likely warn for macro redefinition, even if the macro definition are identical. This problem happens in [ocaml-mccs][1]. The proposed [fix][2] for libraries is to only define the macros when compiling with OCaml strictly older than 4.12, i.e.: #if OCAML_VERSION < 41200 #define ... #endif [1]: https://github.com/AltGr/ocaml-mccs/pull/30 [2]: https://github.com/ocaml/ocaml/issues/5154#issuecomment-644283763 --- Changes | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index c5d9a8f6f57..8e880d40c7a 100644 --- a/Changes +++ b/Changes @@ -38,8 +38,10 @@ Working version (KC Sivaramakrishnan, review by Stephen Dolan, Gabriel Scherer, and Xavier Leroy) -- #9569: Add `Val_none`, `Some_val`, `Is_none`, `Is_some`, `caml_alloc_some`, - and `Tag_some`. +* #5154, #9569, #9734: Add `Val_none`, `Some_val`, `Is_none`, `Is_some`, + `caml_alloc_some`, and `Tag_some`. As these macros are sometimes defined by + authors of C bindings, this change may cause warnings/errors in case of + redefinition. (Nicolás Ojeda Bär, review by Stephen Dolan, Gabriel Scherer, Mark Shinwell, and Xavier Leroy)