Patrick Williams | 7784c42 | 2022-11-17 07:29:11 -0600 | [diff] [blame^] | 1 | From 7dc19632f3115e3f517c6bc80436fe72c1dcdeb4 Mon Sep 17 00:00:00 2001 |
| 2 | From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net> |
| 3 | Date: Sat, 29 Oct 2022 04:16:00 +0200 |
| 4 | Subject: [PATCH] glib/tests/cxx: Ensure NULL is always casted to a pointer |
| 5 | type |
| 6 | |
| 7 | Otherwise it may not be recognized as valid sentinel |
| 8 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/7dc19632f3115e3f517c6bc80436fe72c1dcdeb4] |
| 9 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> |
| 10 | --- |
| 11 | glib/tests/cxx.cpp | 4 ++++ |
| 12 | 1 file changed, 4 insertions(+) |
| 13 | |
| 14 | diff --git a/glib/tests/cxx.cpp b/glib/tests/cxx.cpp |
| 15 | index 045457c6e2..aa5e0cb576 100644 |
| 16 | --- a/glib/tests/cxx.cpp |
| 17 | +++ b/glib/tests/cxx.cpp |
| 18 | @@ -186,7 +186,11 @@ test_steal_pointer (void) |
| 19 | int |
| 20 | main (int argc, char *argv[]) |
| 21 | { |
| 22 | +#if __cplusplus >= 201103L |
| 23 | g_test_init (&argc, &argv, NULL); |
| 24 | +#else |
| 25 | + g_test_init (&argc, &argv, static_cast<void *>(NULL)); |
| 26 | +#endif |
| 27 | |
| 28 | g_test_add_func ("/C++/typeof", test_typeof); |
| 29 | g_test_add_func ("/C++/atomic-pointer-compare-and-exchange", test_atomic_pointer_compare_and_exchange); |
| 30 | -- |
| 31 | GitLab |