summaryrefslogtreecommitdiffstats
path: root/doc/overview_code.c
diff options
context:
space:
mode:
Diffstat (limited to 'doc/overview_code.c')
-rw-r--r--doc/overview_code.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/doc/overview_code.c b/doc/overview_code.c
index 2f6a099..063f829 100644
--- a/doc/overview_code.c
+++ b/doc/overview_code.c
@@ -1,4 +1,4 @@
-// Copyright 2021-2023 David Robillard <d@drobilla.net>
+// Copyright 2021-2024 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
/*
@@ -8,13 +8,8 @@
written such that it at least compiles and will run without crashing.
*/
-#include "zix/attributes.h"
-#include "zix/string_view.h"
-
-#if defined(__GNUC__)
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wunused-variable"
-#endif
+#include <zix/attributes.h>
+#include <zix/string_view.h>
static void
string_views(void)
@@ -24,6 +19,7 @@ string_views(void)
// begin make-empty-string
ZixStringView empty = zix_empty_string();
// end make-empty-string
+ (void)empty;
// begin make-static-string
static const ZixStringView hello = ZIX_STATIC_STRING("hello");
@@ -33,20 +29,17 @@ string_views(void)
// begin measure-string
ZixStringView view = zix_string(string_pointer);
// end measure-string
+ (void)view;
// begin make-string-view
ZixStringView slice = zix_substring(string_pointer, 4);
// end make-string-view
+ (void)slice;
}
-ZIX_CONST_FUNC
-int
+ZIX_CONST_FUNC int
main(void)
{
string_views();
return 0;
}
-
-#if defined(__GNUC__)
-# pragma GCC diagnostic pop
-#endif