Hi, TCC (Tiny C Compiler) does not support C99 `_Pragma()` construct, but hedley will still use it inside of `HEDLEY_PRAGMA()`. This ofcourse does not work as expected and will cause an error (also see godbolt link down below): ```sh $ git clone https://github.com/nemequ/hedley.git --branch dev $ cd hedley $ cat <<'EOF' > main.c #include "hedley.h" HEDLEY_PRAGMA(some text); int main(void) { return 0; } EOF $ tcc main.c main.c:2: error: identifier expected $ tcc --version tcc version 0.9.28rc 2025-01-06 mob@f6385c05 (x86_64 Linux) ``` TCC never supported this (to my knowledge) so I'm not sure why hedley makes a check against version 0.9.17, here: https://github.com/nemequ/hedley/blob/a9229ef2e9ed149d51e3ec8a40261254c8bd1984/hedley.h#L735 Naive fix: ```patch diff --git a/hedley.h b/hedley.h index 1eedf82..e026021 100644 --- a/hedley.h +++ b/hedley.h @@ -716,7 +716,10 @@ # define HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) #endif -#if \ +#if defined(HEDLEY_TINYC_VERSION) +// special case for TINYC which doesn't support _Pragma() but predefines __GNUC__ +# define HEDLEY_PRAGMA(value) +#elif \ (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ defined(__clang__) || \ HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ @@ -732,7 +735,6 @@ HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ - HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ (HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) # define HEDLEY_PRAGMA(value) _Pragma(#value) ``` References: - https://godbolt.org/z/bxc91xvff - https://lists.nongnu.org/archive/html/tinycc-devel/2023-01/msg00024.html - https://lists.nongnu.org/archive/html/tinycc-devel/2024-12/msg00009.html
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by sleeptightAnsiC and has received 1 comments.