Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 854
    • Issues 854
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 55
    • Merge requests 55
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Issues
  • #2338
Closed
Open
Issue created Feb 27, 2021 by Aleksandr Mezin@amezinContributor

clang-cl+c_std=gnu99: G_STATIC_ASSERT broken

Default value of c_std is gnu99 ( https://gitlab.gnome.org/GNOME/glib/-/blob/2.67.4/meson.build#L8 ). When compiling GLib with clang-cl, when not setting c_std manually:

[1/1064] Compiling C object glib/tests/logging.exe.p/logging.c.obj
FAILED: glib/tests/logging.exe.p/logging.c.obj
"clang-cl" "-Iglib\tests\logging.exe.p" "-Iglib\tests" "-I..\glib\tests" "-I." "-I.." "-Iglib" "-I..\glib" "-Isubprojects\proxy-libintl" "-I..\subprojects\proxy-libintl" "/MD" "/nologo" "/showIncludes" "/W2" "/clang:-std=gnu99" "/O2" "/Zi" "-D_GNU_SOURCE" "-fno-strict-aliasing" "-DG_ENABLE_DEBUG" "-DG_LOG_DOMAIN=\"GLib\"" "-UG_DISABLE_ASSERT" "/Fdglib\tests\logging.exe.p\logging.c.pdb" /Foglib/tests/logging.exe.p/logging.c.obj "/c" ../glib/tests/logging.c
In file included from ../glib/tests/logging.c:4:
In file included from ..\glib\glib.h:30:
In file included from ..\glib/galloca.h:32:
..\glib/gtypes.h(463,3): error: expected expression
  G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64));
  ^
..\glib/gmacros.h(757,31): note: expanded from macro 'G_STATIC_ASSERT'
#define G_STATIC_ASSERT(expr) static_assert (expr, "Expression evaluates to false")
                              ^
1 error generated.

With c_std=gnu11 the same code at least compiles (but fails to link #2337 (closed) ).

Assignee
Assign to
Time tracking