From bb45198413ef8efe236afbd665a4623239ac0da0 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Thu, 18 Apr 2024 17:13:09 +0200 Subject: 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. --- test/shadow_variables.cxx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/shadow_variables.cxx (limited to 'test/shadow_variables.cxx') 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 + +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; +} -- cgit v1.2.3