Myer commentary J. Yavner This commentary describes the "Example_myer" directory, which shows Myer's analysis of itself. To create the example, use make Example_myer This command spews many warning messages, because it asks Myer to annotate all header files in /usr/include and libiberty. Only the include files actually referenced by the program get annotated. +------------+ | index.html | +------------+ Lists all files that were colorized, along with the date and time of processing. On RedHat systems, a different version of libiberty is installed in /usr/include, but Myer is unconfused and shows the gcc-distribution version. +--------+ | myer.c | +--------+ This module contains both the main program and a eclectic mix of utility functions, so cohesion is rather poor. Stat_File & IsDir: Since these are the only functions that refer to struct stat, the structure's fields are bright cyan, indicating "bug bait". This does *not* mean that these structure fields are erroneous, only that there is high potential for error here. By isolating the calls to stat, we ensure that we need only "get it right" once, but this code is worth a second look to make sure it's right. AddUID: All occurrences of macro assert() are shown in a fairly bright cyan, even though assert is commonly used in this program, because assert generates a string constant. Macros are shown with the "worst-case" color for the generated constants hiding behind them. Call_cc1: Note the stark contrast in color between concat, perror, exit, and free (all comonly used) versus system and perror (used nowhere else). main: Note the extremely bright cyan for isspace(). This macro is also called from myerhtml, but no other macros from ctype.h are used anywhere in Myer, so it gets flagged as "super bug-bait". +-------------+ | myertoken.c | +-------------+ Note the rather odd color assigned to "#include ". It's very cyan, but not very bright. There are many calls to assert in this program, but assert() is the only item from this file that is used. Several others are defined, so this header has good cohesion but poor coupling. +------------+ | myerhtml.c | +------------+ myerHtml_index: The adjacent calls to strchr and strrchr have different colors, because strrchr is used much more often in this program. The call to strchr is correct here, but was worth a second look. +-----------+ | myerenv.c | +-----------+ One would not expect any insight in such a simple file, but note (under RedHat 8.0 at least) that several of the strings are duplicated! This is made clearer by the reduced brightness of the duplicates. +-----------+ | hashtab.h | +-----------+ Unused types and structure fields are purple, because they are effectively module-local. The unused global-variable declarations are noticably more cyan than the unused functions. Why exactly is that? +----------+ | string.h | +----------+ Compare the declarations for strrchr (used a lot), strchr (used once) and strcspn (not used). There is a slight difference in brightness. Further research is needed on how to make these distinctions more noticable without screwing up anything else. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gcc commentary ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This commentary describes the "Example_gcc" directory, which shows Myer's analysis of gcc. To create the example, use make Example_gcc This command takes a long time, involves a lot of RAM/swapspace thrashing, and spews many warning messages. cpplib.h: Macro TTYPE_TABLE is complicated, but Myer handles it properly. It calls macros OP and TK, which have a definition within cpplib.h that uses only the first argument. There's different definitions for these in cpplex.c, which is the only file where the second argument does anything. Myer shows a merged view with colors on both arguments. c-common.c, timevar.c: These files are not shown, they use #include directives inside function definitions. tradcif.c: This file is not shown. It defines a macro without arguments, "YYSTACK_ALLOC", that expands to "alloc", the name of another macro that does take arguments. Myer doesn't handle this (there's a "FIXME" comment in the code).