# Using zig c++ to compile a C++ file, how to suppress \_Nonnull warnings?

**URL:** <https://ziggit.dev/t/using-zig-c-to-compile-a-c-file-how-to-suppress-nonnull-warnings/16268>\
**Category:** Help\
**Tags:** c\
**Created:** [June 20, 2026, 5:49pm UTC](https://ziggit.dev/t/using-zig-c-to-compile-a-c-file-how-to-suppress-nonnull-warnings/16268 "2026-06-20T17:49:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahfoud202](https://ziggit.dev/user_avatar/ziggit.dev/mahfoud202/32/8759_2.png) [@mahfoud202](https://ziggit.dev/u/mahfoud202)\
**Post date:** [June 20, 2026, 5:49pm UTC](https://ziggit.dev/t/using-zig-c-to-compile-a-c-file-how-to-suppress-nonnull-warnings/16268/1 "2026-06-20T17:49:16Z")

</div>

I am using zig c++ to compile a C++ file that links against GMP. I keep getting this warning from GMP headers:

```zig
warning: pointer is missing a nullability type specifier
(_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]

```

The code compiles and runs fine. I just want to hide these warnings.  
Is there a way to do this with zig c++ flags?

---

<div class="post-metadata">

**Author:** ![naxlavun](https://ziggit.dev/user_avatar/ziggit.dev/naxlavun/32/7596_2.png) [@naxlavun](https://ziggit.dev/u/naxlavun)\
**Post date:** [June 21, 2026, 2:36am UTC](https://ziggit.dev/t/using-zig-c-to-compile-a-c-file-how-to-suppress-nonnull-warnings/16268/2 "2026-06-21T02:36:05Z")

</div>

try adding the `-Wno-nullability-completeness` flag

---

<div class="post-metadata">

**Author:** ![mahfoud202](https://ziggit.dev/user_avatar/ziggit.dev/mahfoud202/32/8759_2.png) [@mahfoud202](https://ziggit.dev/u/mahfoud202)\
**Post date:** [June 21, 2026, 2:41pm UTC](https://ziggit.dev/t/using-zig-c-to-compile-a-c-file-how-to-suppress-nonnull-warnings/16268/3 "2026-06-21T14:41:11Z")

</div>

I also tried `-w` to silence all warnings but the warnings still show up, I’m not sure if this is a bug or not.

---

<div class="post-metadata">

**Author:** ![mahfoud202](https://ziggit.dev/user_avatar/ziggit.dev/mahfoud202/32/8759_2.png) [@mahfoud202](https://ziggit.dev/u/mahfoud202)\
**Post date:** [June 21, 2026, 2:43pm UTC](https://ziggit.dev/t/using-zig-c-to-compile-a-c-file-how-to-suppress-nonnull-warnings/16268/4 "2026-06-21T14:43:50Z")

</div>

They seem to be coming from zig’s own files, not from GMP:

```zig
.../zig/0.16.0/lib/libcxx/include/string:3884:75: warning: pointer is
      missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
 3884 | _LIBCPP_EXPORTED_FROM_ABI unsigned long stoul(const wstring& __str, size_t*__ idx = nullptr, int __base = 10);

```

---

<div class="post-metadata">

**Author:** ![alexrp](https://ziggit.dev/user_avatar/ziggit.dev/alexrp/32/2793_2.png) [@alexrp](https://ziggit.dev/u/alexrp)\
**Post date:** [June 21, 2026, 2:48pm UTC](https://ziggit.dev/t/using-zig-c-to-compile-a-c-file-how-to-suppress-nonnull-warnings/16268/5 "2026-06-21T14:48:19Z")

</div>

This will be fixed in 0.17.0: [https://codeberg.org/ziglang/zig/pulls/31868](https://codeberg.org/ziglang/zig/pulls/31868)
