On Wed, Jul 13, 2005 at 01:40:34PM -0400, mental@...3... wrote:
Quoting Bryce Harrington <bryce@...260...>:
If someone could narrow that to a list of no more than, say, 20 cases, it would be feasible to automate running as a weekly check.
20 test cases would mean roughly ... log2(20) ~= 4.3 ... distinct macros.
(I'm assuming you didn't mean 20 individual macros to test, which would mean testing ... 2^20 = 1048576 ... different permutations)
What I meant was 20 individual compiles. I think the system could cope with about that many, max. However you'd like to see that broken down in terms of permutations is open.
This is, of course, assuming that the value of the #define isn't itself significant...
A lot of these things are tied to platform feature tests, so we kind of have to ignore those, and some are repeated tests for the same macro, but ... even given that I don't easily forsee being able to pare ~2000 some conditions down to four or five to actually test.
Oh. You know what, I bet a lot of those are header file #include armor. That's the one GOOD use of #ifndef.
Can you subtract the number of header files in the tree from both your #ifndef and #define figures and see what you get?
There are:
652 header files 1053 uniq ifdef's 785 uniq ifndef's
If I do a grep -v on "*_H", that removes a lot of the armor
834 uniq non-armored ifdef 240 uniq non-armored ifndef
Playing around with it a bit more, this seems to remove a lot of the uninteresting clutter:
egrep -hsr "#ifdef|#ifndef" . | egrep -v "cxxtest|ChangeLog|config|m4" \ | egrep "^\s*#" | sed -e 's/#ifn*def //' | grep -iv "_H" \ | egrep -v '__cplusplus|__STDC|GNUC' | sed -e 's/ *$//' \ | sort | uniq | wc -l
This cuts us down from 1838 to 269. Most of the remaining defines appear to be stuff worth reviewing. A good chunk of those 269 defs look pretty crufty, maybe a lot of those could be dropped directly. I'll attach the list below.
Bryce
# __CYGWIN__ APSTUDIO_INVOKED APSTUDIO_READONLY_SYMBOLS ARC_VERBOSE Avoid_Underflow BEZIER_DEBUG BRYCE_FLOATS BR_NO_MACROS BR_THREADS CLAMP CONST COUNT_ALLOCS CROSS_COMPILE CR_DEBUG CXXTEST_MAX_DUMP_SIZE CXXTEST_MOCK_NAMESPACE CXXTEST_USER_VALUE_TRAITS Check_FLT_ROUNDS DATADIR DEBUG DEBUG_MATCH DEBUG_METADATA DEBUG_SCOPE_COUNT DEBUG_SKELETON DEBUG_STREAMS DEBUG_XXXbrendan DEBUG_brendan DEBUG_notbrendan DIR_SEPARATOR DIR_SEPARATOR_2 DUMB_OS_LIKE_WINDOWS DUMP_CHANGE_INFO DYNA_DRAW_VERBOSE EDITLINE ELLIPSE_VERBOSE ENABLE_BINRELOC ENABLE_NLS ENABLE_OOM_TESTING ENTER EXPORT_JS_API Error FALSE FALSE /* Mac standard is lower case false */ FAR FREEBSD_WORKAROUND GC_MARK_DEBUG G_ENABLE_DEBUG G_OS_WIN32 HASHMETER HAS_ECVT HAS_SHGetSpecialFolderLocation HAVE_ATOMIC_DWORD_ACCESS HAVE_BIND_TEXTDOMAIN_CODESET HAVE_FPSETMASK HAVE_GCC_LOOP_BUG HAVE_GTK_WINDOW_FULLSCREEN HAVE_GTK_WINDOW_SET_DEFAULT_ICON_FROM_FILE HAVE_LIBWMF HAVE_LOCALTIME_R HAVE_MALLINFO HAVE_NEW_INTERSECTOR_CODE HAVE_STRUCT_MALLINFO_FORDBLKS HAVE_STRUCT_MALLINFO_FSMBLKS HAVE_STRUCT_MALLINFO_UORDBLKS HAVE_STRUCT_MALLINFO_USMBLKS HAVE_VA_COPY HAVE_VA_LIST_AS_ARRAY HAVE_WATCOM_BUG_2 HAVE_XPCONNECT HPUX HT_ENUMERATE_NEXT /* XXX don't require jshash.h */ HUGE_VAL /* this is the only routine that uses HUGE_VAL */ INFNAN_CHECK INK_DUMP_FILENAME_CONV INK_DUMP_FOPEN IS_LITTLE_ENDIAN Inaccurate_Divide JSDEBUGGER JSDEBUGGER_C_UI JSDEBUGGER_JAVA_UI JSD_LOWLEVEL_SOURCE JS_ARENAMETER JS_ARENA_CONST_ALIGN_MASK JS_ARGUMENT_FORMATTER_DEFINED JS_DHASHMETER JS_DHASH_MIN_SIZE JS_GCMETER JS_PROPERTY_CACHE_METERING JS_STACK_GROWTH_DIRECTION JS_THREADSAFE JS_VERSION LABEL LAZY_STANDARD_CLASSES LIVECONNECT LONG_MAX LT_DLLAZY_OR_NOW Llong Long MALLOC MAX MAX_INTERP_LEVEL METER_PARSENODES METHOD MIN MOZILLA_CLIENT MULTIPLICITY M_E M_LN10 M_LN2 M_LOG10E M_LOG2E M_PI M_SQRT1_2 M_SQRT2 Move NAME_ALL_GC_ROOTS NAN_WORD0 NAN_WORD1 NDEBUG NEWSOS4 NO_IEEE_Scale NR_ARENA_ITEM_DEBUG_CASCADE NR_ARENA_ITEM_VERBOSE NR_DISABLE_CAST_CHECKS NR_USE_GENERIC_RENDERER NR_VERBOSE NR_VERTEX_ALLOC NSPR_LOCK No_leftright OFFSET_VERBOSE OLD_GETTER_SETTER Omit_Private_Memory PANGO_WEIGHT_SEMIBOLD // not available on pango before 1.8 PBM_SETBARCOLOR PBM_SETRANGE32 PERLCONNECT PERL_OBJECT POPT_TABLEEND PRIVATE_MEM RESERVE_ECMA_KEYWORDS RESERVE_JAVA_KEYWORDS RND_PRODQUOT ROUND_BIASED RTLD_GLOBAL SEEN_INKSCAPE_WIDGETS_LAYER_SELECTOR SEEN_INKSCAPE_XML_SP_REPR_EVENT_VECTOR SEEN_IN_DT_COORDSYS SEEN_SP_CONN_END SEEN_SP_CONN_END_PAIR SET_OBJ_INFO SET_SCOPE_INFO SOLARIS SPCS_PREVIEW SPIRAL_DEBUG SPIRAL_VERBOSE SP_DOCUMENT_DEBUG_IDLE SP_FS_VERBOSE SP_GRADIENT_VERBOSE SP_MACROS_SILENT SP_OBJECT_DEBUG SP_OBJECT_DEBUG_CASCADE SP_PS_VERBOSE SP_SS_VERBOSE STRICT_RGBA SUNOS4 SWIGINLINE SWIGINTERN SWIGINTERNSHORT SWIGMODINIT SWIG_COBJECT_TYPES SWIG_LINK_RUNTIME SWIG_TEMPLATE_DISAMBIGUATOR SWIG_TYPE_TABLE Sudden_Underflow TED TESTFTOS TEST_CVTARGS TEST_EXPORT TOO_MUCH_GC TRUE TRUE /* Mac standard is lower case true */ ULLong ULong UNIT_SELECTOR_VERBOSE VERBOSE WIN32 WITH_GNOME_PRINT WITH_GNOME_VFS WITH_GTKSPELL WITH_INKJAR WITH_MMX WITH_MODULES WITH_PERL WITH_PYTHON WITH_UNICODE_ESCAPE_AND_RANGE WORDS_BIGENDIAN XP_BEOS XP_MAC XP_MACOSX XP_MAC_MPW XP_OS2 XP_UNIX XP_WIN XP_WIN16 XXX _CXXTEST_FACTOR _CXXTEST_OLD_STD _CXXTEST_OLD_TEMPLATE_SYNTAX _CXXTEST_PARTIAL_TEMPLATE_SPECIALIZATION _IEEE_LIBM _MSC_VER _MSC_VER // Visual C++ _POSIX_MODE _PREFIX_C_ _PTRDIFF_T_DEFINED _REENTRANT _SCALB_INT _SEQUENT_ _SVID3_MODE _SVID_GETTOD /* Defined only on Solaris, see Solaris <sys/types.h> */ _USE_WRITE _WIN32 _WINDLL _WINDOWS _XOPEN_MODE _XP_Core_ __BORLANDC__ __DMC__ // Digital Mars __GNU_LIBRARY__ __LITTLE_ENDIAN __MWERKS__ __NEWVALID /* special setup for Sun test regime */ __SP_DESKTOP_C__ __SP_SELECTION_CHEMISTRY_C__ __WINDOWS_386__ apply arena_item_tile_cache convert do_close do_open faster_flatten form invert js_cpucfg___ lalaWITH_MODULES list my_alpha_ligne my_avl my_bit_ligne my_defs my_font_factory my_math my_math_seg my_path my_raster_font my_shape my_text_wrapper pTHX_ ref scalar signal test_glyph_liv tile_cache_stats va_start vform with_splotch_killer yyerror yylex yyparse