From cdc89dad16cd5c87ba45fa3e1010b4782cdb739d Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 16 Feb 2022 11:42:06 +0100 Subject: [PATCH] work around an issue in Flex 2.6.4 The fallback definition of SIZE_MAX supplied by flex was not preprocessor friendly and prevented robin_hood.hh from doing "#if SIZE_MAX == UINT64_MAX", as observed by Marc Espie on OpenBSD. * spot/parseaut/scanaut.ll, spot/parsetl/scantl.ll: Define __STDC_VERSION__ just so that the code generated by Flex include . * NEWS: Mention the bug. * THANKS: Add Marc. --- NEWS | 3 +++ THANKS | 1 + spot/parseaut/scanaut.ll | 8 ++++++++ spot/parsetl/scantl.ll | 12 ++++++++++-- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 20c507343..928a25da2 100644 --- a/NEWS +++ b/NEWS @@ -62,6 +62,9 @@ New in spot 2.10.4.dev (net yet released) - reduce_parity() produced incorrect results when applied to automata with deleted edges. + - work around a portability issue in Flex 2.6.4 preventing + compilation on OpenBSD. + New in spot 2.10.4 (2022-02-01) Bug fixed: diff --git a/THANKS b/THANKS index 193dccaf7..9eb566483 100644 --- a/THANKS +++ b/THANKS @@ -31,6 +31,7 @@ Joachim Klein Juan Tzintzun Juraj Major Kristin Y. Rozier +Marc Espie Martin Dieguez Lodeiro Matthias Heizmann Maxime Bouton diff --git a/spot/parseaut/scanaut.ll b/spot/parseaut/scanaut.ll index 4b4d03c37..8cccaec0e 100644 --- a/spot/parseaut/scanaut.ll +++ b/spot/parseaut/scanaut.ll @@ -26,6 +26,14 @@ /* %option debug */ %top{ #include "config.h" +/* Flex 2.6.4's test for relies on __STDC_VERSION__ + which is undefined in C++. So without that, it will define + its own integer types, including a broken SIZE_MAX definition. + So let's define __STDC_VERSION__ to make sure gets + included. */ +#if HAVE_INTTYPES_H && !(defined __STDC_VERSION__) +# define __STDC_VERSION__ 199901L +#endif } %{ #include diff --git a/spot/parsetl/scantl.ll b/spot/parsetl/scantl.ll index fbb7444a7..34fbfef32 100644 --- a/spot/parsetl/scantl.ll +++ b/spot/parsetl/scantl.ll @@ -1,6 +1,6 @@ /* -*- coding: utf-8 -*- -** Copyright (C) 2010-2015, 2017-2019, 2021, Laboratoire de Recherche -** et Développement de l'Epita (LRDE). +** Copyright (C) 2010-2015, 2017-2019, 2021-2022, Laboratoire de +** Recherche et Développement de l'Epita (LRDE). ** Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 ** (LIP6), département Systèmes Répartis Coopératifs (SRC), Université ** Pierre et Marie Curie. @@ -28,6 +28,14 @@ %top{ #include "config.h" +/* Flex 2.6.4's test for relies on __STDC_VERSION__ + which is undefined in C++. So without that, it will define + its own integer types, including a broken SIZE_MAX definition. + So let's define __STDC_VERSION__ to make sure gets + included. */ +#if HAVE_INTTYPES_H && !(defined __STDC_VERSION__) +# define __STDC_VERSION__ 199901L +#endif } %{ #include