Remove GCC marning

This commit is contained in:
Arnaud 2026-05-19 11:28:20 +04:00
parent 269d97548c
commit 9f7833edf1
No known key found for this signature in database
GPG Key ID: A6C7C781817146FA
2 changed files with 14 additions and 4 deletions

View File

@ -12,14 +12,18 @@ const
rootPath = currentSourcePath.parentDir().parentDir().replace('\\', '/')
libplumPath = rootPath & "/vendor/libplum"
includePath = libplumPath & "/include/plum"
libraryPath = libplumPath & "/build/libplum.a"
libraryPath = libplumPath & "/libplum.a"
{.passc: "-I" & includePath & " -DPLUM_STATIC".}
{.passl: libraryPath.}
# libplum declares some parameters as `const T*` in C (read-only pointer).
# Nim has no equivalent, so the generated C code drops the `const`, causing
# a type mismatch warning in GCC 15+. This flag suppresses that warning.
# It is safe because we never write through those pointers.
{.passc: "-Wno-incompatible-pointer-types".}
# a type mismatch warning in GCC 15+. This pragma suppresses that warning
# only in this translation unit and is valid for both C and C++.
{.emit: """
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wno-incompatible-pointer-types"
#endif
""".}
when defined(windows):
{.passl: "-lws2_32 -liphlpapi -lbcrypt".}

View File

@ -12,6 +12,12 @@ import chronos/threadsync
import results
import ./libplum
{.emit: """
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
#endif
""".}
export results
{.pragma: callback, cdecl, raises: [], gcsafe.}