summaryrefslogtreecommitdiff
path: root/test/shadow_variables.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2024-04-18 17:13:09 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2024-04-18 17:13:09 +0200
commitbb45198413ef8efe236afbd665a4623239ac0da0 (patch)
tree9b769652a1eec4c0b0a26a1334e72f7b65de5633 /test/shadow_variables.cxx
parent2c21e520f4859904739deb7d058b084f314ed47d (diff)
Test public headers for shadowed variables (STR 2728)
This program is built only when using CMake and a GNU or Clang compiler to detect shadowed variables in header files. Developers should fix such warnings whenever they see them during the build to avoid user reports.
Diffstat (limited to 'test/shadow_variables.cxx')
-rw-r--r--test/shadow_variables.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/shadow_variables.cxx b/test/shadow_variables.cxx
new file mode 100644
index 000000000..7690c1d11
--- /dev/null
+++ b/test/shadow_variables.cxx
@@ -0,0 +1,29 @@
+//
+// Public header compilation test program for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2024 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file. If this
+// file is missing or damaged, see the license at:
+//
+// https://www.fltk.org/COPYING.php
+//
+// Please see the following page on how to report bugs and issues:
+//
+// https://www.fltk.org/bugs.php
+//
+
+// The following header file is generated by CMake and includes all
+// public FLTK headers:
+
+#include "include_all.h"
+
+#include <stdio.h>
+
+int main() {
+ printf("This program includes all FLTK header files for compilation.\n");
+ printf("It should be compiled with `g++ (clang++) -Wshadow ...` or similar.\n");
+ printf("This program does nothing.\n");
+ return 0;
+}