Devs: I've been looking into solving STR#2728, which is to have FLTK detect shadow variables in our public .H files.
It makes sense to create a test program that #include<>s all our public .H files and check them for shadow variables by simply building the test program with the compiler shadow variable flag enabled, such that any shadow variables cause the FLTK build to fail. I can think of two approaches to doing this, which I've attached to STR #2728 <http://www.fltk.org/str.php?L2728> Curious which you think is better.. I kinda like (A) the most: A. Have the test/Makefile automatically generate a shadow_variables.cxx file on the fly via a one-liner perl command in the Makefile. (No svn check in of the file is needed, it's automatically generated) PROS: Automation -- in the future if devs add new .H files, the Makefile will automatically include and test them.. no special steps needed. Pretty much fool-proof. CONS: This creates a perhaps undesirable dependency on perl. B. Create a static shadow_variables.cxx and check it in. PROS: The test program is like all the others, and no automation dependency on perl. CONS: Devs would have to *manually* maintain the shadow_variables.cxx file, updating it whenever new .H files are added to FLTK, which if forgotten would go silently untested. ..or if you have better suggs, feel free to follow up. _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
