On 2020-01-22 01:41, Antonio Scuri wrote:
Hi,
Please exclude from your report the files that are in the folders:
D:\tecgraf\iup\srcscintilla\scintilla*\ (several folders)
D:\tecgraf\iup\srcmglplot\src\*
D:\tecgraf\iup\srcmglplot\mgl2\*
These are third party library sources that we will not edit. And this
will make your report more usable.
Today CD and IM reports have about 300 lines. The IUP report has 4000
lines...
Best,
Scuri
[...]
Despite all the odds, I've managed to at least partially serve this
request. [Note: I've found and fixed some typos, only in comments,
while writing this email... fingers crossed that I've caught them
all, as I do not have an external reviewer to help me.]
TL;DR: The attached iup-r560.out warning summary is 500 lines, not 4000
lines. However, the test may be too naive.
--
What I've done is added a "blacklist" to the build parsing script
(parse-build.lua):
------------------------------------------------------------------------
-- Spell out directories and/or filenames where reports are to be
-- suppressed.
--
-- WARNING: The code uses Lua's regular expression matching, not
-- the common system filename globbing matching e.g. implemented by
-- the shell.
--
-- The list of patterns are tried in first-to-last order, so, where
-- overlap between specifications exist, the more-specific pattern,
-- (e.g. "path/a/b/math-lib3/conv.c"), should be placed earlier than
-- a less-specific pattern, (e.g. "path/a/b.*/").
--
-- We keep a tally of suppressed items, and this tally is included in
-- the report.
-- Note that "tecmake.mak" needs to report a complete path to the
-- source file, (e.g. via "report-build-item" Bash script), to show
-- both the root project path, (e.g. "iup/"), as well as the series
-- of directories to the source, (e.g. "srcmglplot/mgl2/").
gcc.Blacklist = {
{"iup/srcscintilla/scintilla.-/", 0},
{"iup/srcmglplot/src/", 0},
{"iup/srcmglplot/mgl2/", 0},
}
------------------------------------------------------------------------
If any blacklist activity takes place, a tally is given at the top of
the report:
* Warning diagnostics suppressed by blacklist patterns:
Tally Pattern
----- -------
11 iup/srcscintilla/scintilla.-/
1138 iup/srcmglplot/src/
0 iup/srcmglplot/mgl2/
(End of list.)
------------------------------------------------------------------------
In order to implement blacklists, I need to know the full path of
(at least) each source file. This leads to three changes to the IUP
build system: (We give the list here, in roughly reverse order, as
it's easier to explain that way.):
------------------------------------------------------------------------
1. Change tecmake.mak automatic rules to show the relative path of each
C/C++ component being built (iup-r5620-tecmake.mak.patch). Note we use
"$<" instead of "$(<F)", so we get local path information:
Index: tecmake.mak
===================================================================
--- tecmake.mak (revision 5620)
+++ tecmake.mak (working copy)
@@ -1726,19 +1726,19 @@
# Compilation Rules
$(OBJDIR)/%.o: $(SRCDIR)/%.c
- @echo ''; echo Tecmake: compiling $(<F) ...
+ @$(REPORT_BUILD_ITEM) tecmake.mak $<
$(ECHO)$(CC) -c $(CFLAGS) -o $@ $<
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
- @echo ''; echo Tecmake: compiling $(<F) ...
+ @$(REPORT_BUILD_ITEM) tecmake.mak $<
$(ECHO)$(CPPC) -c $(CXXFLAGS) -o $@ $<
$(OBJDIR)/%.o: $(SRCDIR)/%.cxx
- @echo ''; echo Tecmake: compiling $(<F) ...
+ @$(REPORT_BUILD_ITEM) tecmake.mak $<
$(ECHO)$(CPPC) -c $(CXXFLAGS) -o $@ $<
$(OBJDIR)/%.o: $(SRCDIR)/%.cc
- @echo ''; echo Tecmake: compiling $(<F) ...
+ @$(REPORT_BUILD_ITEM) tecmake.mak $<
$(ECHO)$(CPPC) -c $(CXXFLAGS) -o $@ $<
$(OBJDIR)/%.o: $(SRCDIR)/%.f
@@ -1887,3 +1887,4 @@
@echo "Tecmake Posix Version $(VERSION)"
#---------------------------------#
+
------------------------------------------------------------------------
2. The REPORT_BUILD_ITEM named above is set up in Makefile, and it
references Makefile variable $(CURDIR), so it can be called from
anywhere in the hierarchy. This is an IUP-specific solution, and both
IM and CD descend into a "src/" subdirectory for compilation, whereas
IUP has a slew of top-level projects, some of which may be excluded
(e.g. as per the previous EXCLUDE_TARGETS change to Makefile):
Index: Makefile
===================================================================
--- Makefile (revision 5620)
+++ Makefile (working copy)
@@ -6,6 +6,12 @@
TARGETS := $(filter-out $(EXCLUDE_TARGETS), $(TARGETS))
OTHERDEPENDENCIES := iupgtk iupmot
+# Add a facility to report directory paths as well as filenames when
+# invoking GCC. This opens the door for improved analysis of
+# diagnostics, notably allowing warnings to be triaged, e.g.
+# suppressing warnings from third-party libraries that have been frozen.
+export REPORT_BUILD_ITEM = "$(CURDIR)/report-build-item"
+
.PHONY: do_all $(TARGETS) $(OTHERDEPENDENCIES)
do_all: $(TARGETS)
------------------------------------------------------------------------
3. "report-build-item" is a Bash script; I'm only working on Linux
for this facility, and have not investigated other platforms:
--
#!/bin/bash
# report-build-item: Show a summary of next build step, but give more
# context, especially file paths, than the previous tecmake.mak code.
# Current directory (PWD) and MAKELEVEL are maintained by GNU Make.
# Typical usage in Makefile (e.g. via tecmake.mak):
#$(OBJDIR)/%.o: $(SRCDIR)/%.c
# @$(REPORT_RELATIVE_PATH) $<
# $(ECHO)$(CC) -c $(CFLAGS) -o $@ $<
# @copyright (C) 2020 Grouse Software
# @license Permissive (MIT) license [see file LICENSE].
# @author sur-behoffski, mailto:<sur-behoff...@grouse.com.au>
#-----------------------------------------------------------------------
# Give the parameters descriptive names.
TargetDir="$PWD"
Level="$MAKELEVEL"
Makefile="$1"
FullTarget="$2"
# If FullTarget begins with "./", remove it.
FullTarget="${FullTarget#./}"
# Create a pattern to pick off the last "Level" path components.
Subst=""
for i in $( seq $(($Level - 2)) ) ; do
Subst="${Subst}[^/]*/"
done
Subst="${Subst}.*$"
Relpath="$( echo "$TargetDir" | sed -E "s:.*/(${Subst}):\1:" )"
echo ""
echo "[${Makefile}] CWD: '${Relpath}'; Compiling: '${FullTarget}'"
------------------------------------------------------------------------
And finally, see the attached iup-r5620.out consolidated warnings
given by the altered parse-build.lua script (also attached).
parse-build.lua script is showing some cracks at its seams, as it has
sometimes not faithfully tracked the changes/improvements in the compiler
output (especially gcc 7 onwards).
Hope this helps,
sur-behoffski (Brenton Hoff)
programmer, Grouse Software
* Warning diagnostics suppressed by blacklist patterns:
Tally Pattern
----- -------
11 iup/srcscintilla/scintilla.-/
1138 iup/srcmglplot/src/
0 iup/srcmglplot/mgl2/
(End of list.)
* No diagnostics for:
#include expects "FILENAME" or <FILENAME>
missing binary operator before token "("
converting to non-pointer type <TYPE> from NULL [-Wconversion-null]
suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
assignment discards <TYPE> qualifier from pointer target type
[-Wdiscarded-qualifiers]
comparison between <ENUM1> and <ENUM2> [-Wenum-compare]
format <FMT> expects argument of type <TYPE1>, but argument <NUM> has type
<TYPE2> [-Wformat=]
too many arguments for format [-Wformat-extra-args]
<FUNC> may write a terminating nul past the end of the destination
[-Wformat-overflow=]
<DIRECTIVE> directive writing 1 byte into a region of size between 0 and
<BYTECOUNT> [-Wformat-overflow=]
<DIRECTIVE> directive writing <BYTECOUNT1> bytes into a region of size
between <BYTECOUNT2> and <BYTECOUNT3> [-Wformat-overflow=]
<DIRECTIVE> directive writing between <BYTECOUNT1> and <BYTECOUNT2> bytes
into a region of size between <BYTECOUNT3> and <BYTECOUNT4> [-Wformat-overflow=]
<DIRECTIVE> directive writing up to <BYTECOUNT1> bytes into a region of size
<BYTECOUNT2> [-Wformat-overflow=]
format not a string literal and no format arguments [-Wformat-security]
implicit declaration of function <FUNC> [-Wimplicit-function-declaration]
<VAR> is usually a function [-Wmain]
<VAR> may be used uninitialized in this function [-Wmaybe-uninitialized]
missing braces around initializer [-Wmissing-braces]
the use of `tmpnam' is dangerous, better use `mkstemp'
suggest parentheses around assignment used as truth value [-Wparentheses]
suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
suggest parentheses around '&&' within '||' [-Wparentheses]
comparison between pointer and zero character constant [-Wpointer-compare]
<VAR> will be initialized after [-Wreorder]
no return statement in function returning non-void [-Wreturn-type]
control reaches end of non-void function [-Wreturn-type]
case value <LABEL> not in enumerated type <ENUM> [-Wswitch]
this 'else' clause does not guard... [-Wmisleading-indentation]
this 'while' clause does not guard... [-Wmisleading-indentation]
dereferencing type-punned pointer will break strict-aliasing rules
[-Wstrict-aliasing]
enumeration value <ENUM> not handled in switch [-Wswitch]
<EXPRESSION> is used uninitialized in this function [-Wuninitialized]
ignoring #pragma omp for [-Wunknown-pragmas]
ignoring #pragma omp section [-Wunknown-pragmas]
<VAR> defined but not used [-Wunused-const-variable=]
<FUNC> declared <TYPE> but never defined [-Wunused-function]
label <LABEL> defined but not used [-Wunused-label]
statement with no effect [-Wunused-value]
value computed is not used [-Wunused-value]
<VAR> defined but not used [-Wunused-variable]
deprecated conversion from string constant to <TYPE> [-Wwrite-strings]
(End of list.)
<FUNC> is deprecated [-Wdeprecated-declarations]:
iup_thread.c:167:[Function:iThreadCreateMethod]: g_mutex_new
iup_thread.c:197:[Function:iThreadDestroyMethod]: g_mutex_free
gtk/iupgtk_globalattrib.c:160:[Function:iupdrvGetGlobal]:
gdk_screen_get_width
gtk/iupgtk_globalattrib.c:161:[#included-from:gtk/iupgtk_globalattrib.c:161]:
gdk_screen_get_height
gtk/iupgtk_globalattrib.c:205:[#included-from:gtk/iupgtk_globalattrib.c:205]:
gdk_visual_get_best_depth
gtk/iupgtk_label.c:138:[Function:gtkLabelSetAlignmentAttrib]:
gtk_misc_set_alignment
gtk/iupgtk_font.c:208:[Function:gtkFontUpdateWidget]:
gtk_widget_override_font
gtk/iupgtk_filedlg.c:455:[Function:gtkFileDlgPopup]:
gtk_widget_set_double_buffered
gtk/iupgtk_button.c:141:[Function:gtkButtonSetAlignmentAttrib]:
gtk_button_set_alignment
gtk/iupgtk_toggle.c:244:[Function:gtkToggleSetAlignmentAttrib]:
gtk_button_set_alignment
gtk/iupgtk_tree.c:2029:[Function:gtkTreeCellTextEditingStarted]:
gtk_widget_override_font
gtk/iupgtk_canvas.c:501:[Function:gtkCanvasSetDXAttrib]:
gtk_adjustment_value_changed
gtk/iupgtk_canvas.c:589:[Function:gtkCanvasSetDYAttrib]:
gtk_adjustment_value_changed
gtk/iupgtk_canvas.c:677:[Function:gtkCanvasSetBgColorAttrib]:
gtk_widget_set_double_buffered
gtk/iupgtk_canvas.c:678:[#included-from:gtk/iupgtk_canvas.c:678]:
gtk_widget_set_double_buffered
gtk/iupgtk_canvas.c:687:[#included-from:gtk/iupgtk_canvas.c:687]:
gtk_widget_set_double_buffered
gtk/iupgtk_canvas.c:688:[#included-from:gtk/iupgtk_canvas.c:688]:
gtk_widget_set_double_buffered
gtk/iupgtk_canvas.c:692:[#included-from:gtk/iupgtk_canvas.c:692]:
gtk_widget_set_double_buffered
gtk/iupgtk_canvas.c:693:[#included-from:gtk/iupgtk_canvas.c:693]:
gtk_widget_set_double_buffered
gtk/iupgtk_dialog.c:973:[Function:gtkDialogSetBackgroundAttrib]:
gdk_window_set_background_pattern
gtk/iupgtk_dialog.c:1009:[#included-from:gtk/iupgtk_dialog.c:1009]:
gdk_window_set_background_pattern
gtk/iupgtk_dialog.c:1100:[Function:gtkDialogGetStatusIcon]:
gtk_status_icon_new
gtk/iupgtk_dialog.c:1113:[Function:gtkDialogSetTrayAttrib]:
gtk_status_icon_set_visible
gtk/iupgtk_dialog.c:1123:[Function:gtkDialogSetTrayTipAttrib]:
gtk_status_icon_set_has_tooltip
gtk/iupgtk_dialog.c:1125:[#included-from:gtk/iupgtk_dialog.c:1125]:
gtk_status_icon_set_tooltip_markup
gtk/iupgtk_dialog.c:1127:[#included-from:gtk/iupgtk_dialog.c:1127]:
gtk_status_icon_set_tooltip_text
gtk/iupgtk_dialog.c:1130:[#included-from:gtk/iupgtk_dialog.c:1130]:
gtk_status_icon_set_has_tooltip
gtk/iupgtk_dialog.c:1141:[Function:gtkDialogSetTrayImageAttrib]:
gtk_status_icon_set_from_pixbuf
gtk/iupgtk_common.c:151:[Function:iupdrvReparent]: gtk_widget_reparent
gtk/iupgtk_common.c:212:[Function:iupdrvRedrawNow]:
gdk_window_process_updates
gtk/iupgtk_common.c:567:[Function:iupgtkSetFgColor]:
gtk_widget_override_color
gtk/iupgtk_common.c:568:[#included-from:gtk/iupgtk_common.c:568]:
gtk_widget_override_color
gtk/iupgtk_common.c:569:[#included-from:gtk/iupgtk_common.c:569]:
gtk_widget_override_color
gtk/iupgtk_common.c:618:[Function:gtkEmptyCursor]: gdk_cursor_new
gtk/iupgtk_common.c:690:[Function:gtkGetCursor]: gdk_cursor_new
gtk/iupgtk_common.c:893:[#included-from:gtk/iupgtk_common.c:893]:
gdk_device_manager_get_client_pointer
gtk/iupgtk_common.c:916:[#included-from:gtk/iupgtk_common.c:916]:
gdk_device_manager_get_client_pointer
gtk/iupgtk_common.c:1046:[#included-from:gtk/iupgtk_common.c:1046]:
gdk_device_manager_get_client_pointer
gtk/iupgtk_menu.c:148:[Function:gtkItemUpdateImage]:
gtk_image_menu_item_get_image
gtk/iupgtk_menu.c:152:[#included-from:gtk/iupgtk_menu.c:152]:
gtk_image_menu_item_set_image
gtk/iupgtk_menu.c:159:[#included-from:gtk/iupgtk_menu.c:159]:
gtk_image_menu_item_set_image
gtk/iupgtk_info.c:93:[#included-from:gtk/iupgtk_info.c:93]:
gdk_device_manager_get_client_pointer
<FUNC1> is deprecated: Use <FUNC2> instead [-Wdeprecated-declarations]:
iup_thread.c:142:[Function:iThreadSetStartAttrib]: g_thread_create
g_thread_new
gtk/iupgtk_open.c:304:[Function:gtkUpdateGlobalColors]:
gtk_style_context_get_background_color gtk_render_background
gtk/iupgtk_open.c:315:[#included-from:gtk/iupgtk_open.c:315]:
gtk_style_context_get_background_color gtk_render_background
gtk/iupgtk_open.c:319:[#included-from:gtk/iupgtk_open.c:319]:
gtk_style_context_get_background_color gtk_render_background
gtk/iupgtk_tabs.c:438:[Function:gtkTabsChildAddedMethod]:
gtk_button_set_focus_on_click gtk_widget_set_focus_on_click
gtk/iupgtk_list.c:1535:[Function:gtkListMapMethod]:
gtk_combo_box_set_focus_on_click gtk_widget_set_focus_on_click
gtk/iupgtk_list.c:1539:[#included-from:gtk/iupgtk_list.c:1539]:
gtk_combo_box_set_focus_on_click gtk_widget_set_focus_on_click
gtk/iupgtk_tree.c:2839:[Function:gtkTreeMapMethod]: gdk_color_get_type
gdk_rgba_get_type
gtk/iupgtk_common.c:874:[Function:iupdrvSendKey]: gdk_keymap_get_default
gdk_keymap_get_for_display
gtk/iupgtk_common.c:892:[Function:iupdrvWarpPointer]:
gdk_display_get_device_manager gdk_display_get_default_seat
gtk/iupgtk_common.c:915:[Function:iupdrvSendMouse]:
gdk_display_get_device_manager gdk_display_get_default_seat
gtk/iupgtk_common.c:1045:[Function:iupgtkWindowGetPointer]:
gdk_display_get_device_manager gdk_display_get_default_seat
gtk/iupgtk_menu.c:87:[Function:iupdrvMenuPopup]: gtk_menu_popup
(gtk_menu_popup_at_widget, gtk_menu_popup_at_pointer, gtk_menu_popup_at_rect)
gtk/iupgtk_menu.c:217:[Function:gtkItemActivate]:
gtk_image_menu_item_get_type gtk_menu_item_get_type
gtk/iupgtk_menu.c:336:[Function:gtkItemSetTitleImageAttrib]:
gtk_image_menu_item_get_type gtk_menu_item_get_type
gtk/iupgtk_menu.c:347:[Function:gtkItemSetImageAttrib]:
gtk_image_menu_item_get_type gtk_menu_item_get_type
gtk/iupgtk_menu.c:358:[Function:gtkItemSetImpressAttrib]:
gtk_image_menu_item_get_type gtk_menu_item_get_type
gtk/iupgtk_menu.c:400:[Function:gtkItemSetValueAttrib]:
gtk_image_menu_item_get_type gtk_menu_item_get_type
gtk/iupgtk_menu.c:428:[Function:gtkItemMapMethod]:
gtk_image_menu_item_new_with_label gtk_menu_item_new_with_label
gtk/iupgtk_menu.c:504:[Function:gtkSubmenuSetImageAttrib]:
gtk_image_menu_item_get_type gtk_menu_item_get_type
gtk/iupgtk_menu.c:525:[Function:gtkSubmenuMapMethod]:
gtk_image_menu_item_new_with_label gtk_menu_item_new_with_label
gtk/iupgtk_draw_cairo.c:60:[Function:iupdrvDrawCreateCanvas]:
gdk_cairo_create gdk_window_begin_draw_frame() and
gdk_drawing_context_get_cairo_context()
gtk/iupgtk_info.c:43:[Function:iupdrvGetScreenSize]:
gdk_screen_get_primary_monitor gdk_display_get_primary_monitor
gtk/iupgtk_info.c:47:[#included-from:gtk/iupgtk_info.c:47]:
gdk_screen_get_monitor_workarea gdk_monitor_get_workarea
gtk/iupgtk_info.c:65:[Function:iupdrvGetFullSize]:
gdk_screen_get_primary_monitor gdk_display_get_primary_monitor
gtk/iupgtk_info.c:69:[#included-from:gtk/iupgtk_info.c:69]:
gdk_screen_get_monitor_geometry gdk_monitor_get_geometry
gtk/iupgtk_info.c:76:[Function:iupdrvGetScreenDepth]:
gdk_visual_get_system gdk_screen_get_system_visual
gtk/iupgtk_info.c:92:[Function:iupdrvGetCursorPos]:
gdk_display_get_device_manager gdk_display_get_default_seat
gtk/iupgtk_info.c:103:[Function:iupdrvGetKeyState]:
gdk_display_get_pointer gdk_device_get_position
implicit declaration of function <FUNC1>; did you mean <FUNC2>?
[-Wimplicit-function-declaration]:
iup_str.c:1855:[Function:iupStrTmpFileName]: close pclose
assignment from incompatible pointer type [-Wincompatible-pointer-types]:
iup_cd.c:85:[Function:cdContextIup]:
cdIupContext.cxCreateCanvas = cdcreatecanvasIUP;
^
iup_cd.c:126:[Function:cdContextIupDBuffer]:
cdIupContextDBuffer.cxCreateCanvas = cdcreatecanvasIUP_DBUFFER;
^
iup_cd.c:167:[Function:cdContextIupDBufferRGB]:
cdIupContextDBufferRGB.cxCreateCanvas = cdcreatecanvasIUP_DBUFFERRGB;
^
initialization from incompatible pointer type [-Wincompatible-pointer-types]:
iup_cd.c:520:[Function:cdContextIupDBufferRGB]:
cdcreatecanvas,
passing argument <NUM> of <FUNC> from incompatible pointer type
[-Wincompatible-pointer-types]:
iup_scintilladlg.c:2131:[Function:item_pagesetup_action_cb]: 2
getListIndex
margin_units_index = getListIndex(margin_units, margin_units_list,
sizeof(margin_units_list));
iup_scintilladlg.c:2132:[Function:item_pagesetup_action_cb]: 2
getListIndex
word_wrap_index = getListIndex(word_wrap, word_wrap_list,
sizeof(word_wrap_list));
iup_scintilladlg.c:2133:[Function:item_pagesetup_action_cb]: 2
getListIndex
color_index = getListIndex(color, color_list, sizeof(color_list));
iup_scintilladlg.c:2149:[Function:item_pagesetup_action_cb]: 2
getListValue
margin_units = getListValue(margin_units_index, margin_units_list);
iup_scintilladlg.c:2150:[Function:item_pagesetup_action_cb]: 2
getListValue
word_wrap = getListValue(word_wrap_index, word_wrap_list);
iup_scintilladlg.c:2151:[Function:item_pagesetup_action_cb]: 2
getListValue
color = getListValue(color_index, color_list);
cast to pointer from integer of different size [-Wint-to-pointer-cast]:
iup_image.c:1119:[Function:IupImage]:
params[0] = (void*)width;
iup_image.c:1120:[Function:IupImage]:
params[1] = (void*)height;
iup_image.c:1129:[Function:IupImageRGB]:
params[0] = (void*)width;
iup_image.c:1130:[Function:IupImageRGB]:
params[1] = (void*)height;
iup_image.c:1139:[Function:IupImageRGBA]:
params[0] = (void*)width;
iup_image.c:1140:[Function:IupImageRGBA]:
params[1] = (void*)height;
iup_thread.c:83:[Function:iThreadSetExitAttrib]:
g_thread_exit((gpointer)exit_code);
gtk/iupgtk_open.c:241:[Function:gtkSetGlobalAttrib]:
IupSetGlobal("XSCREEN", (char*)XDefaultScreen(xdisplay));
suggest parentheses around arithmetic in operand of '|' [-Wparentheses]:
iup_str.c:1318:[Function:iStrLatin1toUTF8]:
*s = 0xc0 | (uc >> 6) & 0x1F; s++; /* 2+1+5 bits */
~~~~~~~~~~^~~~~~
cast from pointer to integer of different size [-Wpointer-to-int-cast]:
iup_image.c:1032:[Function:iImageCreate]:
width = (int)(params[0]);
iup_image.c:1033:[Function:iImageCreate]:
height = (int)(params[1]);
iup_image.c:1053:[Function:iImageCreate]:
if (((int)(params[2]) == -1) || ((int)(params[3]) == -1)) /* NULL or
compacted in one pointer */
iup_image.c:1053:[Function:iImageCreate]:
if (((int)(params[2]) == -1) || ((int)(params[3]) == -1)) /* NULL or
compacted in one pointer */
iup_image.c:1055:[Function:iImageCreate]:
if ((int)(params[2]) != -1)
iup_image.c:1065:[Function:iImageCreate]:
imgdata[i] = (unsigned char)((int)(params[i + 2]));
this 'for' clause does not guard... [-Wmisleading-indentation]:
./mgl2/datac.h:413:[MemberFunction:dual mglDataC::operator=(dual)]:
for(long i=0;i<nx*ny*nz;i++) a[i]=val; return val; }
^~~
./mgl2/datac.h:413:42: note: ...this statement, but the latter is
misleadingly indented as if it were guarded by the 'for'
for(long i=0;i<nx*ny*nz;i++) a[i]=val; return val; }
^~~~~~
./mgl2/datac.h:417:[MemberFunction:dual mglDataC::operator=(mreal)]:
for(long i=0;i<nx*ny*nz;i++) a[i]=val; return val; }
^~~
./mgl2/datac.h:417:42: note: ...this statement, but the latter is
misleadingly indented as if it were guarded by the 'for'
for(long i=0;i<nx*ny*nz;i++) a[i]=val; return val; }
^~~~~~
this 'if' clause does not guard... [-Wmisleading-indentation]:
iupPlot.h:167:[MemberFunction:void iupPlotData::RemoveSample(int)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:167:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:187:[MemberFunction:void iupPlotDataReal::InsertSample(int,
double)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:187:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:214:[MemberFunction:void iupPlotDataString::InsertSample(int,
const char*)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:214:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:236:[MemberFunction:void iupPlotDataBool::InsertSample(int,
bool)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:236:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:167:[MemberFunction:void iupPlotData::RemoveSample(int)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:167:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:187:[MemberFunction:void iupPlotDataReal::InsertSample(int,
double)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:187:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:214:[MemberFunction:void iupPlotDataString::InsertSample(int,
const char*)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:214:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:236:[MemberFunction:void iupPlotDataBool::InsertSample(int,
bool)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:236:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:167:[MemberFunction:void iupPlotData::RemoveSample(int)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:167:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:187:[MemberFunction:void iupPlotDataReal::InsertSample(int,
double)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:187:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:214:[MemberFunction:void iupPlotDataString::InsertSample(int,
const char*)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:214:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:236:[MemberFunction:void iupPlotDataBool::InsertSample(int,
bool)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:236:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:167:[MemberFunction:void iupPlotData::RemoveSample(int)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:167:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:187:[MemberFunction:void iupPlotDataReal::InsertSample(int,
double)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:187:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:214:[MemberFunction:void iupPlotDataString::InsertSample(int,
const char*)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:214:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:236:[MemberFunction:void iupPlotDataBool::InsertSample(int,
bool)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:236:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:167:[MemberFunction:void iupPlotData::RemoveSample(int)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:167:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:187:[MemberFunction:void iupPlotDataReal::InsertSample(int,
double)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:187:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:214:[MemberFunction:void iupPlotDataString::InsertSample(int,
const char*)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:214:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:236:[MemberFunction:void iupPlotDataBool::InsertSample(int,
bool)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:236:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:167:[MemberFunction:void iupPlotData::RemoveSample(int)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:167:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:187:[MemberFunction:void iupPlotDataReal::InsertSample(int,
double)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:187:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:214:[MemberFunction:void iupPlotDataString::InsertSample(int,
const char*)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:214:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:236:[MemberFunction:void iupPlotDataBool::InsertSample(int,
bool)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:236:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:167:[MemberFunction:void iupPlotData::RemoveSample(int)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:167:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:187:[MemberFunction:void iupPlotDataReal::InsertSample(int,
double)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:187:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:214:[MemberFunction:void iupPlotDataString::InsertSample(int,
const char*)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:214:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:236:[MemberFunction:void iupPlotDataBool::InsertSample(int,
bool)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:236:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:167:[MemberFunction:void iupPlotData::RemoveSample(int)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:167:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:187:[MemberFunction:void iupPlotDataReal::InsertSample(int,
double)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:187:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:214:[MemberFunction:void iupPlotDataString::InsertSample(int,
const char*)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:214:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:236:[MemberFunction:void iupPlotDataBool::InsertSample(int,
bool)]:
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
iupPlot.h:236:47: note: ...this statement, but the latter is misleadingly
indented as if it were guarded by the 'if'
if (inSampleIndex < 0) inSampleIndex = 0; if (inSampleIndex > mCount)
inSampleIndex = mCount;
^~
./mgl2/type.h:124:[MemberFunction:void mglColor::Set(mglColor, float)]:
if(bright<0) bright=0; if(bright>2.f) bright=2.f;
^~
./mgl2/type.h:124:26: note: ...this statement, but the latter is
misleadingly indented as if it were guarded by the 'if'
if(bright<0) bright=0; if(bright>2.f) bright=2.f;
^~
./mgl2/data.h:781:[MemberFunction:virtual mreal mglDataF::valueD(mreal,
mreal, mreal, mreal*, mreal*, mreal*) const]:
if(di) *di = 0; if(dj) *dj = 0; if(dk) *dk = 0;
^~
./mgl2/data.h:781:19: note: ...this statement, but the latter is
misleadingly indented as if it were guarded by the 'if'
if(di) *di = 0; if(dj) *dj = 0; if(dk) *dk = 0;
^~
./mgl2/datac.h:460:[MemberFunction:virtual mreal mglDataC::valueD(mreal,
mreal, mreal, mreal*, mreal*, mreal*) const]:
if(dz) *dz = res?(real(aa)*real(az)+imag(aa)*imag(az))/res:0; return
res; }
^~
./mgl2/datac.h:460:65: note: ...this statement, but the latter is
misleadingly indented as if it were guarded by the 'if'
if(dz) *dz = res?(real(aa)*real(az)+imag(aa)*imag(az))/res:0; return
res; }
^~~~~~
ignoring #pragma omp critical [-Wunknown-pragmas]:
mgl2/mgl.h:2154:[#included-from:mgl2/mgl.h:2154]:
ignoring #pragma omp parallel [-Wunknown-pragmas]:
./mgl2/datac.h:412:[#included-from:./mgl2/datac.h:412]:
./mgl2/datac.h:416:[#included-from:./mgl2/datac.h:416]:
ignoring #pragma warning [-Wunknown-pragmas]:
iupPlot.h:38:[MemberFunction:void iupPlotDataBool::InsertSample(int,
bool)]:
iup_mglplot.cpp:40:[#included-from:iup_mglplot.cpp:40]:
<FUNC> defined but not used [-Wunused-function]:
iup_recplay.c:331:[Function:iPlayReadStr]: iFlatButtonMotion_CB
ignoring return value of <FUNC>, declared with attribute warn_unused_result
[-Wunused-result]:
iup_recplay.c:214:[Function:iPlayReadChar]: fscanf
iup_recplay.c:216:[Function:iPlayReadChar]: fread
iup_recplay.c:194:[Function:iPlayReadFloat]: fscanf
iup_recplay.c:196:[Function:iPlayReadFloat]: fread
iup_recplay.c:186:[Function:iPlayReadInt]: fscanf
iup_recplay.c:188:[Function:iPlayReadInt]: fread
iup_recplay.c:204:[Function:iPlayReadByte]: fscanf
iup_recplay.c:208:[Function:iPlayReadByte]: fread
iup_recplay.c:221:[Function:iPlayReadStr]: fread
iup_recplay.c:227:[Function:iPlayReadStr]: fread
matrixex/iupmatex_clipboard.c:696:[Function:iMatrixReadFile]: fread
iup_scintilladlg.c:538:[Function:readFile]: fread
unused variable <VAR> [-Wunused-variable]:
iup_thread.c:195:[#included-from:iup_thread.c:195]: thread
variable <VAR> set but not used [-Wunused-but-set-variable]:
iup_thread.c:138:[#included-from:iup_thread.c:138]: old_thread
ISO C++ forbids converting a string constant to <TYPE> [-Wwrite-strings]:
iup_mglplot.cpp:354:[Function:char* iMglPlotGetTexFontName(const char*)]:
char*
iup_mglplot.cpp:358:[Function:char* iMglPlotGetTexFontName(const char*)]:
char*
iup_mglplot.cpp:362:[Function:char* iMglPlotGetTexFontName(const char*)]:
char*
iup_mglplot.cpp:1061:[Function:char* iMglPlotMakeFormatString(double,
double)]: char*
iup_mglplot.cpp:1079:[Function:char* iMglPlotMakeFormatString(double,
double)]: char*
iup_mglplot.cpp:1080:[Function:char* iMglPlotMakeFormatString(double,
double)]: char*
iup_mglplot.cpp:1081:[Function:char* iMglPlotMakeFormatString(double,
double)]: char*
iup_mglplot.cpp:1082:[Function:char* iMglPlotMakeFormatString(double,
double)]: char*
iup_mglplot.cpp:1083:[Function:char* iMglPlotMakeFormatString(double,
double)]: char*
iup_mglplot.cpp:1084:[Function:char* iMglPlotMakeFormatString(double,
double)]: char*
iup_mglplot.cpp:1085:[Function:char* iMglPlotMakeFormatString(double,
double)]: char*
iup_mglplot.cpp:1086:[Function:char* iMglPlotMakeFormatString(double,
double)]: char*
iup_mglplot.cpp:1087:[Function:char* iMglPlotMakeFormatString(double,
double)]: char*
iup_mglplot.cpp:1088:[Function:char* iMglPlotMakeFormatString(double,
double)]: char*
iup_mglplot.cpp:2131:[Function:char* iMglPlotGetLineStyle(char)]: char*
iup_mglplot.cpp:2132:[Function:char* iMglPlotGetLineStyle(char)]: char*
iup_mglplot.cpp:2133:[Function:char* iMglPlotGetLineStyle(char)]: char*
iup_mglplot.cpp:2134:[Function:char* iMglPlotGetLineStyle(char)]: char*
iup_mglplot.cpp:2135:[Function:char* iMglPlotGetLineStyle(char)]: char*
iup_mglplot.cpp:2136:[Function:char* iMglPlotGetLineStyle(char)]: char*
iup_mglplot.cpp:2137:[Function:char* iMglPlotGetLineStyle(char)]: char*
iup_mglplot.cpp:2138:[Function:char* iMglPlotGetLineStyle(char)]: char*
iup_mglplot.cpp:2155:[Function:int iMglPlotSetGridAttrib(Ihandle*, const
char*)]: char*
iup_mglplot.cpp:2157:[Function:int iMglPlotSetGridAttrib(Ihandle*, const
char*)]: char*
iup_mglplot.cpp:2159:[Function:int iMglPlotSetGridAttrib(Ihandle*, const
char*)]: char*
iup_mglplot.cpp:2161:[Function:int iMglPlotSetGridAttrib(Ihandle*, const
char*)]: char*
iup_mglplot.cpp:2163:[Function:int iMglPlotSetGridAttrib(Ihandle*, const
char*)]: char*
iup_mglplot.cpp:2165:[Function:int iMglPlotSetGridAttrib(Ihandle*, const
char*)]: char*
iup_mglplot.cpp:2167:[Function:int iMglPlotSetGridAttrib(Ihandle*, const
char*)]: char*
iup_mglplot.cpp:2180:[Function:char* iMglPlotGetGridAttrib(Ihandle*)]:
char*
iup_mglplot.cpp:2508:[Function:char*
iMglPlotGetDSMarkStyleAttrib(Ihandle*)]: char*
iup_mglplot.cpp:2509:[Function:char*
iMglPlotGetDSMarkStyleAttrib(Ihandle*)]: char*
iup_mglplot.cpp:2510:[Function:char*
iMglPlotGetDSMarkStyleAttrib(Ihandle*)]: char*
iup_mglplot.cpp:2511:[Function:char*
iMglPlotGetDSMarkStyleAttrib(Ihandle*)]: char*
iup_mglplot.cpp:2512:[Function:char*
iMglPlotGetDSMarkStyleAttrib(Ihandle*)]: char*
iup_mglplot.cpp:2513:[Function:char*
iMglPlotGetDSMarkStyleAttrib(Ihandle*)]: char*
iup_mglplot.cpp:2514:[Function:char*
iMglPlotGetDSMarkStyleAttrib(Ihandle*)]: char*
iup_mglplot.cpp:2515:[Function:char*
iMglPlotGetDSMarkStyleAttrib(Ihandle*)]: char*
iup_mglplot.cpp:2516:[Function:char*
iMglPlotGetDSMarkStyleAttrib(Ihandle*)]: char*
iup_mglplot.cpp:2517:[Function:char*
iMglPlotGetDSMarkStyleAttrib(Ihandle*)]: char*
iup_mglplot.cpp:2518:[Function:char*
iMglPlotGetDSMarkStyleAttrib(Ihandle*)]: char*
iup_mglplot.cpp:2519:[Function:char*
iMglPlotGetDSMarkStyleAttrib(Ihandle*)]: char*
iup_mglplot.cpp:2520:[Function:char*
iMglPlotGetDSMarkStyleAttrib(Ihandle*)]: char*
iup_mglplot.cpp:2521:[Function:char*
iMglPlotGetDSMarkStyleAttrib(Ihandle*)]: char*
iup_mglplot.cpp:2774:[Function:char* iMglPlotGetAxisLabelPosition(int)]:
char*
iup_mglplot.cpp:2776:[Function:char* iMglPlotGetAxisLabelPosition(int)]:
char*
iup_mglplot.cpp:2778:[Function:char* iMglPlotGetAxisLabelPosition(int)]:
char*
iup_mglplot.cpp:3167:[Function:char* iMglPlotGetAxisScale(const char*)]:
char*
iup_mglplot.cpp:3169:[Function:char* iMglPlotGetAxisScale(const char*)]:
char*
iup_mglplot.cpp:3171:[Function:char* iMglPlotGetAxisScale(const char*)]:
char*
iup_mglplot.cpp:3173:[Function:char* iMglPlotGetAxisScale(const char*)]:
char*
iup_mglplot.cpp:3621:[Function:char* iMglPlotGetAxisXCrossOrigin(double)]:
char*
iup_mglplot.cpp:3623:[Function:char* iMglPlotGetAxisXCrossOrigin(double)]:
char*
Index: tecmake.mak
===================================================================
--- tecmake.mak (revision 5620)
+++ tecmake.mak (working copy)
@@ -1726,19 +1726,19 @@
# Compilation Rules
$(OBJDIR)/%.o: $(SRCDIR)/%.c
- @echo ''; echo Tecmake: compiling $(<F) ...
+ @$(REPORT_BUILD_ITEM) tecmake.mak $<
$(ECHO)$(CC) -c $(CFLAGS) -o $@ $<
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
- @echo ''; echo Tecmake: compiling $(<F) ...
+ @$(REPORT_BUILD_ITEM) tecmake.mak $<
$(ECHO)$(CPPC) -c $(CXXFLAGS) -o $@ $<
$(OBJDIR)/%.o: $(SRCDIR)/%.cxx
- @echo ''; echo Tecmake: compiling $(<F) ...
+ @$(REPORT_BUILD_ITEM) tecmake.mak $<
$(ECHO)$(CPPC) -c $(CXXFLAGS) -o $@ $<
$(OBJDIR)/%.o: $(SRCDIR)/%.cc
- @echo ''; echo Tecmake: compiling $(<F) ...
+ @$(REPORT_BUILD_ITEM) tecmake.mak $<
$(ECHO)$(CPPC) -c $(CXXFLAGS) -o $@ $<
$(OBJDIR)/%.o: $(SRCDIR)/%.f
@@ -1887,3 +1887,4 @@
@echo "Tecmake Posix Version $(VERSION)"
#---------------------------------#
+
#!/usr/bin/env lua
--- Collate warning diagnostics from a full compiler build, so that
-- the user can be more effective in dealing with warnings in the
-- build output. A file/directory blacklist facility is included,
-- so that errors deemed to be unfixable (usually a third-party
-- library that is now no longer a candidate for changes/updates/fixes)
-- can be excluded.
-- @module parse-build-blacklist
-- Given the full output from a project build from some base, such as:
--
-- $ cd base/SVN/iup-r5620
-- $ LC_ALL=C make >../../iup-r5620.txt 2>&1
-- $ cd ../..
--
-- this script looks for warning/error messages, parses them into separate
-- categories, and reports a list of errors in each category. This mode of
-- presentation helps prioritise/triage the messages, hiding the majority
-- of the output that comes from successful builds, and collating errors
-- by category:
--
-- ./parse-build-blacklist iup-r5620.txt >iup-r5620.out
--
-- This script works ony with limited internationalisation and
-- localisation variants: In particular, the locale of compiler
-- messages must match the locale of the template warning lines below,
-- also, the character encoding must be either ASCII or UTF-8; these
-- constraints are why "LC_ALL=C" is given in the build example above.
-- @copyright (C) 2016-2020 Grouse Software
-- @license Permissive (MIT) license [reproduced below].
-- @author sur-behoffski, mailto:<sur-behoff...@grouse.com.au>
--[[
Copyright and License:
This software is licensed under the terms of the MIT license (reproduced
below).
========================================================================
Copyright (C) 2016-2020 Grouse Software Pty Ltd.
Written by sur-behoffski.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
========================================================================
--]]
-- Use rocks to (a) Normalize Lua 5.1/5.2/5.3 version differences; and
-- (b) Do some simple dynamic checking of variable references.
local _ENV = require("std.normalize"){}
local strict = require("std.strict")
-- Although these libraries are already inbuilt, explicitly import them
-- anyway, mainly so that requirements are documented.
local debug = require("debug")
local io = require("io")
local os = require("os")
local string = require("string")
local table = require("table")
------------------------------------------------------------------------
-- "Global" constants: Args, ScriptName and ShellInvocation.
-- (Note also Lua-provided "arg".)
local Args
local ScriptName
local ShellInvocation
Args = {...}
ScriptName = debug.getinfo(1, "S").short_src
ShellInvocation = ScriptName == arg[0]
------------------------------------------------------------------------
--- Shorthand function to make C-like printed formatting easier.
-- @tparam string Format C-style template formatting string.
-- @tparam ... Values to fill into template/format.
-- @return Value(s) returned by io.write(); may be (nil, ErrStr) if the
-- write failed.
local function printf(Format, ...)
return io.write(Format:format(...))
end
------------------------------------------------------------------------
--- Give the user guidance on how to invoke the program, either from a
-- help request, or because of an error.
-- @tparam number Status Value reported to caller via os.exit().
local function Usage(Status)
printf([[
Usage: %s MAKE-LOGFILE
Where MAKE-LOGFILE is the full output of building the sources,
e.g.:
$ cd base
$ tar xzvf im-3.13_Sources.tar.gz
$ cd im/src
$ make >../../im-make-3.13.out 2>&1
$ cd ../..
$ %s im-make-3.13.out >im-make-3.13-summary.txt
]], ScriptName, ScriptName)
os.exit(Status)
end
------------------------------------------------------------------------
--- Read the entire file, breaking the file into an array of paragraphs,
-- and also breaking down each paragraph into an array of lines
-- (as strings).
-- @tparam FilePath Path String naming filepath to build output text.
-- @return An array containing all paragraphs of the file, in order.
-- Each paragraph entry is itself an array, with one file text line per
-- entry, in sequential order.
local function ReadFileParagraphs(Path)
local f = assert(io.open(Path))
local Paras = {}
local Lines = {}
for l in f:lines() do
if l == "" then
-- Suppress empty (0-line) paragraphs.
if #Lines > 0 then
Paras[#Paras + 1] = Lines
Lines = {}
end
elseif l:match("In file included from ") then
-- Terminate previous paragraph, then fudge in
-- a "gcc" call that isn't reported by the
-- build output, but is still present as we
-- compile dependencies.
Paras[#Paras + 1] = Lines
Lines = {"", "gcc (dependencies)...", l}
else
Lines[#Lines + 1] = l
end
end
assert(f:close())
return Paras
end
------------------------------------------------------------------------
--- GCC-related information about error parsing.
-- Table to store compiler diagnostics as an array, obtained by
-- splitting the template line-by-line. Each diagnostic has a
-- human-readable version (the template text), and a
-- Lua-pattern-matching version, including the use of captures to
-- extract specific fields.
local gcc = {}
gcc.Diagnostics = {}
-- List of lines that look like diagnostics, bu were not matched in
-- our list. Some of these may be false positives, but some may be
-- because the diagnostics list is incomplete.
gcc.ReviewLines = {}
------------------------------------------------------------------------
--[[
This text slab gives a list of patterns to match within paragraph
lines, given in a human-readable template format. Later, the text
is processed in a number of ways:
For human-readable category headings:
* The text slab is processed into lines in an array (table);
* Any trailing <NEXT> is removed, as it is a special marker for
the pattern matching code, and would serve as a distraction if
left visible in the human-readable version.
For pattern matching, we do more:
1. Lua patterns have quite a number of special characters that would
regularly appear in prose templates, such as "-" and ".". We want
these characters to not have any special meaning, so we add a "%"
escape so all text becomes plain text during a match;
2. Then, we work through all the placeholder markers in the template,
such as <VAR>, replacing each one with a pattern-matching
capture incantation so that the text matched by the marker will become
part of a set of captured string(s) that concisely pulls out the key
names and information in messages, with reduced verbosity; and
3. As before, we split the text slab into lines, with one pattern per
line, so that we can enumerate through the patterns easily for each
candidate line of the compiler paragraph output.
Diagnostic lines below are sorted by alphabetical name of diagnostic
switch, then by leading text of message. The first line, and the
final few lines starting with <ENCLOSURE>, are exempt from this rule
(and, in fact, work in tandem to provide more information about the
context of the diagnostic). Above all, do not touch line 1.
--]]
gcc.Templates = [[
DO NOT use this line (line 1), as we use an empty capture to get ENCLOSURE.
#include expects "FILENAME" or <FILENAME><NEXT2>
missing binary operator before token "("<NEXT5>
converting to non-pointer type <TYPE> from NULL [-Wconversion-null]
suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
<FUNC> is deprecated [-Wdeprecated-declarations]
<FUNC1> is deprecated: Use <FUNC2> instead [-Wdeprecated-declarations]
assignment discards <TYPE> qualifier from pointer target type [-Wdiscarded-qualifiers]
comparison between <ENUM1> and <ENUM2> [-Wenum-compare]
format <FMT> expects argument of type <TYPE1>, but argument <NUM> has type <TYPE2> [-Wformat=]
too many arguments for format [-Wformat-extra-args]<NEXT>
<FUNC> may write a terminating nul past the end of the destination [-Wformat-overflow=]
<DIRECTIVE> directive writing 1 byte into a region of size between 0 and <BYTECOUNT> [-Wformat-overflow=]
<DIRECTIVE> directive writing <BYTECOUNT1> bytes into a region of size between <BYTECOUNT2> and <BYTECOUNT3> [-Wformat-overflow=]
<DIRECTIVE> directive writing between <BYTECOUNT1> and <BYTECOUNT2> bytes into a region of size between <BYTECOUNT3> and <BYTECOUNT4> [-Wformat-overflow=]
<DIRECTIVE> directive writing up to <BYTECOUNT1> bytes into a region of size <BYTECOUNT2> [-Wformat-overflow=]
format not a string literal and no format arguments [-Wformat-security]<NEXT>
implicit declaration of function <FUNC> [-Wimplicit-function-declaration]
implicit declaration of function <FUNC1>; did you mean <FUNC2>? [-Wimplicit-function-declaration]
assignment from incompatible pointer type [-Wincompatible-pointer-types]<NEXT2>
initialization from incompatible pointer type [-Wincompatible-pointer-types]<NEXT>
passing argument <NUM> of <FUNC> from incompatible pointer type [-Wincompatible-pointer-types]<NEXT>
cast to pointer from integer of different size [-Wint-to-pointer-cast]<NEXT>
<VAR> is usually a function [-Wmain]
<VAR> may be used uninitialized in this function [-Wmaybe-uninitialized]<NEXT5>
missing braces around initializer [-Wmissing-braces]<NEXT>
the use of `tmpnam' is dangerous, better use `mkstemp'
suggest parentheses around arithmetic in operand of '|' [-Wparentheses]<NEXT2>
suggest parentheses around assignment used as truth value [-Wparentheses]<NEXT2>
suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]<NEXT2>
suggest parentheses around '&&' within '||' [-Wparentheses]<NEXT2>
comparison between pointer and zero character constant [-Wpointer-compare]
cast from pointer to integer of different size [-Wpointer-to-int-cast]<NEXT>
<VAR> will be initialized after [-Wreorder]<NEXT8>
no return statement in function returning non-void [-Wreturn-type]<NEXT>
control reaches end of non-void function [-Wreturn-type]<NEXT>
case value <LABEL> not in enumerated type <ENUM> [-Wswitch]
this 'else' clause does not guard... [-Wmisleading-indentation]<NEXT5>
this 'for' clause does not guard... [-Wmisleading-indentation]<NEXT5>
this 'if' clause does not guard... [-Wmisleading-indentation]<NEXT5>
this 'while' clause does not guard... [-Wmisleading-indentation]<NEXT5>
dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]<NEXT2>
enumeration value <ENUM> not handled in switch [-Wswitch]
<EXPRESSION> is used uninitialized in this function [-Wuninitialized]<NEXT2>
ignoring #pragma omp critical [-Wunknown-pragmas]
ignoring #pragma omp for [-Wunknown-pragmas]
ignoring #pragma omp parallel [-Wunknown-pragmas]
ignoring #pragma omp section [-Wunknown-pragmas]
ignoring #pragma warning [-Wunknown-pragmas]
<VAR> defined but not used [-Wunused-const-variable=]
<FUNC> declared <TYPE> but never defined [-Wunused-function]
<FUNC> defined but not used [-Wunused-function]
label <LABEL> defined but not used [-Wunused-label]
ignoring return value of <FUNC>, declared with attribute warn_unused_result [-Wunused-result]
statement with no effect [-Wunused-value]<NEXT>
value computed is not used [-Wunused-value]
<VAR> defined but not used [-Wunused-variable]
unused variable <VAR> [-Wunused-variable]
variable <VAR> set but not used [-Wunused-but-set-variable]
ISO C++ forbids converting a string constant to <TYPE> [-Wwrite-strings]
deprecated conversion from string constant to <TYPE> [-Wwrite-strings]
<ENCLOSURE><PATH>: In function <FUNC>:
<ENCLOSURE><PATH>: At top level:
<ENCLOSURE><PATH>: In instantiation of <TEMPLATE>:
<ENCLOSURE><PATH>: In constructor <TEMPLATE>:
<ENCLOSURE><PATH>: In member function <FUNC>:
<ENCLOSURE>In file included from <PATH>:<FILELINENR>:
]]
--- Table to map placeholder items with Lua pattern capture codes.
-- Originally, we used the quotes generated by the compiler to
-- sharpen up how we pick of fields; now, we merely force the pattern
-- to match to end-of-line, and, when captures are found, we use a
-- function that can spot, and strip off, both byte markers and utf8
-- sequences.
gcc.MapPlaceholderToCapture_ASCII = {
--?? REVIEWME: #include "<FILENAME>" or <<FILENAME>>?
{"<VAR%d*>", "'(.-)'"},
{"<FUNC%d*>", "'(.-)'"},
{"<TYPE%d*>", "'(.-)'"},
{"<FMT%d*>", "'(.-)'"},
{"<ENUM%d*>", "'(.-)'"},
{"<LABEL%d*>", "'(.-)'"},
{"<EXPRESSION>", "'(.-)'"},
{"<DIRECTIVE%d*>", "'(.-)'"},
{"<TEMPLATE%d*>", "'(.-)'"},
{"<NUM%d*>", "(%%d+)"}, -- Numbers aren't quoted
{"<BYTECOUNT%d*>", "(%%d+)"}, -- Byte counts (sizes?) are
-- unquoted numbers; we've chosen to use an
-- explicit name for clarity.
-- Last few items capture lines that introduce a diagnostic
-- line; these give valuable information describing the
-- enclosing function/template/toplevel-file-name context
-- etc. Ironically, "<FILENAME>" is used in an "#include"
-- diagnostic, but not here -- we use "<PATH>".
-- These lines are not full diagnostics in their own right,
-- so we mark them with an empty capture in position 1.
-- When the code examines the captures, this case is easy to
-- detect; when we see it, we analyse the context it is
-- reporting, and stash this information away to be paired up
-- with the next diagnostic message. It's also the reason why
-- the diagnostic list warns that no diagnostic template lines
-- should be in line 1.
{"<ENCLOSURE>", "^()"},
{"<PATH>", "(.+)"},
{"<FILELINENR>", "(%%d+)"},
}
-- Unicode single-quotation marks used with utf8 encoding:
-- U+2018 Left-Single-Quotation-Mark: 0xe2 0x80 0x98
-- U+2019 Right-Single-Quotation-Mark: 0xe2 0x80 0x99
do
-- UTF-8 Left Single Quote (LSQ) and Right Single Quote (RSQ)
local LSQ = string.char(0xe2, 0x80, 0x98)
local RSQ = string.char(0xe2, 0x80, 0x99)
gcc.MapPlaceholderToCapture_UTF8 = {
{"<VAR%d*>", LSQ .. "(.-)" .. RSQ},
{"<FUNC%d*>", LSQ .. "(.-)" .. RSQ},
{"<TYPE%d*>", LSQ .. "(.-)" .. RSQ},
{"<FMT%d*>", LSQ .. "(.-)" .. RSQ},
{"<ENUM%d*>", LSQ .. "(.-)" .. RSQ},
{"<LABEL%d*>", LSQ .. "(.-)" .. RSQ},
{"<EXPRESSION>", LSQ .. "(.-)" .. RSQ},
{"<DIRECTIVE>", LSQ .. "(.-)" .. RSQ},
{"<TEMPLATE%d*>", LSQ .. "(.-)" .. RSQ},
{"<NUM%d*>", "(%%d+)"}, -- Numbers aren't quoted
{"<BYTECOUNT%d*>", "(%%d+)"}, -- Byte counts (sizes)
-- aren't quoted
{"<ENCLOSURE>", "^()"},
{"<PATH>", "(.+)"},
{"<FILELINENR>", "(%%d+)"},
}
end
------------------------------------------------------------------------
-- Spell out directories and/or filenames where reports are to be
-- suppressed.
--
-- WARNING: The code uses Lua's regular expression matching, not
-- the common system filename globbing matching e.g. implemented by
-- the shell.
--
-- The list of patterns are tried in first-to-last order, so, where
-- overlap between specifications exist, the more-specific pattern,
-- (e.g. "path/a/b/math-lib3/conv.c"), should be placed earlier than
-- a less-specific pattern, (e.g. "path/a/b.*/").
--
-- We keep a tally of supressed items, and this tally is included in
-- the report.
-- Note that "tecmake.mak" needs to report a complete path to the
-- source file, (e.g. via "report-build-item" Bash script), to show
-- both the root project path, (e.g. "iup/"), as well as the series
-- of directories to the source, (e.g. "srcmglplot/mgl2/").
gcc.Blacklist = {
{"iup/srcscintilla/scintilla.-/", 0},
{"iup/srcmglplot/src/", 0},
{"iup/srcmglplot/mgl2/", 0},
}
------------------------------------------------------------------------
--- Work through the table of placeholder/Lua pattern pairs,
-- applying each in turn to the supplied string. The mapping lets
-- users type simple element placeholders, such as <FUNC>, in the
-- template, and changes each to a Lua pattern matching the output of
-- the compiler (in this case, "'(.-)'", although localisation and/or
-- internationalisation, such as UTF-8 encoding, can cause variations).
-- @tparam table Compiler Data about compiler, mainly regarding
-- diagnostics.
-- @tparam string Str Template string to be modified.
-- @tparam table Map
-- @treturn LuaPattern The string with all placeholders modified,
-- ready to be used as a pattern, especially by gsub().
local function RemapPlaceholders(Compiler, Str, Map)
local s = Str
for _, v in ipairs(Map) do
s = s:gsub(v[1], v[2])
end
return s
end
------------------------------------------------------------------------
--- Convert raw compiler message template lines into two paired arrays,
-- one human-readable, the other "gsub captures"-pattern-friendly.
local function SplitRawTemplateText(Compiler)
local Diagnostics = Compiler.Diagnostics
local PartPatterns
local PartPatterns_ASCII
local PartPatterns_UTF8
local LineNr
local AddLines
-- (a) Split the original raw slab of text into lines, as it's more
-- human-friendly to read., and we can use one-to-one array indexing
-- between the "Report" array here and the "Pattern" array below.
for l in Compiler.Templates:gmatch("(.-)\n") do
l = l:gsub("%<NEXT%d*%>$", "")
Diagnostics[#Diagnostics + 1] = {Template = l}
end
-- We convert from template to pattern-matching syntax as a batch
-- operation across the whole template as a single slab of text,
-- then cut it up into lines and add it to the diagnostics array
-- created above.
-- (b) Process the raw text to escape existing pattern-special
-- characters that don't fit the <THINGY> format we use.
PartPatterns
= Compiler.Templates:gsub("[]%%.,=()*+?`'[-]", "%%%0")
-- (c) Change each occurrence of capture markers (<VAR>, <FUNC>,
-- <NUM> etc.) with suitable patterns to make them captures that
-- are extracted and reported. We do this twice, across the
-- single slab of pattern text, once for ASCII, and then again
-- for UTF-8.
PartPatterns_ASCII
= RemapPlaceholders(Compiler,
PartPatterns,
Compiler.MapPlaceholderToCapture_ASCII)
PartPatterns_UTF8
= RemapPlaceholders(Compiler,
PartPatterns,
Compiler.MapPlaceholderToCapture_UTF8)
-- (d) Finally, split the modified text slab into lines, and
-- pair up the template for each of the ASCII and UTF-8 patterns
-- within the Diagostics array. In addition, decode <NEXT>,
-- <NEXT3> etc., and, where found, adding a NextLines entry to
-- the diagnostics array, and also removing the <NEXT%d*> marker
-- from the pattern.
-- Split pattern slab into lines, and decode <NEXT> directives.
LineNr = 1
for l_ASCII in PartPatterns_ASCII:gmatch("(.-)\n") do
if l_ASCII:match("<NEXT%d*>$") then
AddLines = l_ASCII:match("<NEXT(%d*)>")
if AddLines == "" then
AddLines = 1
elseif AddLines then
AddLines = tonumber(AddLines)
else
AddLines = nil
end
Diagnostics[LineNr].AddLines = AddLines
end
LineNr = LineNr + 1
end
-- Split (again) the ASCII pattern slab into lines, and add a
-- line for each ASCII pattern match (removing trailing <NEXT>).
LineNr = 1
for l_ASCII in PartPatterns_ASCII:gmatch("(.-)\n") do
if l_ASCII:match("<NEXT%d*>$") then
l_ASCII = l_ASCII:gsub("<NEXT%d*>$", "")
end
Diagnostics[LineNr].Pattern = {[1] = l_ASCII}
LineNr = LineNr + 1
end
-- Repeat the previous slab split/remove <NEXT>/add to pattern,
-- except that (a) We work on the UTF-8 version; and (b) We
-- suppress the UTF-8 version in the compiler's pattern array
-- for that diagnostic, if it's identical to the ASCII version.
LineNr = 1
for l_UTF8 in PartPatterns_UTF8:gmatch("(.-)\n") do
if l_UTF8:match("<NEXT%d*>$") then
l_UTF8 = l_UTF8:gsub("<NEXT%d*>$", "")
end
if l_UTF8 ~= Diagnostics[LineNr].Pattern[1] then
Diagnostics[LineNr].Pattern[2] = l_UTF8
end
LineNr = LineNr + 1
end
end
------------------------------------------------------------------------
--- Display the result of carving up the single slab of template text
-- into the human-friendly version and the pattern-focussed version.
local function DebugShowDiagnostics(Compiler)
printf(
"DEBUG: Show report/human and Lua/Pattern template lines...\n\n")
for _, Diagnostic in ipairs(Compiler.Diagnostics) do
printf("%s\n ASCII: %s\n",
Diagnostic.Template,
Diagnostic.Pattern[1])
if Diagnostic.Pattern[2] then
printf(" UTF-8: %s\n", Diagnostic.Pattern[2])
end
if Diagnostic.AddLines then
printf("AddLines: %d\n", Diagnostic.AddLines)
end
print("")
end
end
------------------------------------------------------------------------
--- Write out paragraph, for debugging.
-- @tparam table Paragraph Paragraph to display, an array with one line
-- of text per entry.
-- @tparam number ParagraphNr User-defined identifying number for the
-- paragraph; probably a simple incrementing counter.
-- @tparam string Indent Optional text to prefix each paragraph line.
-- If not present, defaults to "".
-- @tparam number Start First index of the array to display; defaults
-- to 1 if not given or if it evaluates to false.
-- @tparam number End Last index of the array to display; defaults to
-- the last array index if not given or if larger than the array size.
local function DebugShowParagraph(Paragraph, ParagraphNr,
Indent, Start, End)
Start = Start or 1
End = End or #Paragraph
if End > #Paragraph then
End = #Paragraph
end
Indent = Indent or ""
printf("\nParagraph %3d:\n", ParagraphNr)
for i = Start, End do
print(Indent .. Paragraph[i])
end
end
------------------------------------------------------------------------
--- Table to simplify mapping wording in a diagnostic line into a short
-- label identifying the kind of object (function, macro, template,
-- whatever) that contains the problem.
local EnclosureKindMap = {
{Pattern = ": In function ",
Kind = "Function"},
{Pattern = ": At top level",
Kind = "At"},
{Pattern = ": In instantiation of ",
Kind = "InstantiationOf"},
{Pattern = ": In constructor ",
Kind = "Constructor"},
{Pattern = ": In member function ",
Kind = "MemberFunction"},
{Pattern = "In file included from ",
Kind = "#included-from"},
{Pattern = ".",
Kind = "(? Unknown kind)"},
}
------------------------------------------------------------------------
--- This function is called each time a compiler diagnostic, listed in
-- the template/pattern structures, has matched a line of the compiler
-- output, and Context has these details.
-- @tparam table Compiler Compiler-related diagnostics and templates.
-- @tparam array Paragraph Table containing one compiler invocation,
-- with the whole invocation collected into a paragraph, and with each
-- line of the output in a separate array element.
-- @tparam table Context Miscellaneous information about the current
-- paragraph, e.g. capturing introductory information in early
-- diagnostic output, so that it can be incorporated into later
-- diagnostic report entries.
local function AnalyseCapture(Compiler, Paragraph)
local BuildItem
local Path, Location
local Report
local ReportList
local AddLines
local RecordDetailedReport
-- Provide a shorthand name for detailed compiler state.
BuildItem = Compiler.BuildItem
--[[
printf("BuildItem.Captures (#BuildItem.Captures=%d):",
#BuildItem.Captures)
for i, v in ipairs(BuildItem.Captures) do
printf(" %d=%s", i, v)
end
printf("\n")
--]]
-- Do we have a single capture which is the entire template?
if BuildItem.Captures[1] == BuildItem.Diagnostic.Template and
#BuildItem.Captures == 1 then
-- Yes, suppress the capture, as it merely echoes the
-- title line introducing the block, but otherwise
-- continue with generating a report for the diagnostic.
BuildItem.Captures = {}
-- No, is the first capture report naming column 1?
elseif BuildItem.Captures[1] == 1 then
-- Yes, this is used exclusively by template entries
-- starting with <ENCLOSURE>. Capture the file path and
-- function/macro/global/whatever name, as this is the
-- introduction to a compiler diagnostic.
BuildItem.EnclosurePath = BuildItem.Captures[2]
BuildItem.EnclosureThingy = BuildItem.Captures[3] or ""
for _, MapItem in ipairs(EnclosureKindMap) do
if BuildItem.Line:match(MapItem.Pattern) then
BuildItem.EnclosureKind = MapItem.Kind
break
end
end
-- We also want the diagnostic line number, but this is
-- given on a per-diagnostic basis, not at this
-- enclosure-reporting point.
-- Continue scanning the next line, having updated
-- Enclosure.
BuildItem.NextLineNr = BuildItem.ScanLineNr + 1
return
end
BuildItem.AddLines = BuildItem.Diagnostic.AddLines
-- Collect the path and line number assoociated with the
-- diagnostic message.
Path, Location = BuildItem.Line:match("^(.-):(.-):")
-- Start filling in the details of a new error report. Take
-- a snapshot of relevant context data, as it relates to the
-- current diagnostic, and will be changed/updated if a
-- later diagnostic is found in the same paragraph.
Report = {}
Report.RelativeFilename = BuildItem.RelativeFilename
Report.EnclosurePath = BuildItem.EnclosurePath
Report.EnclosureKind = BuildItem.EnclosureKind
Report.EnclosureThingy = BuildItem.EnclosureThingy
Report.Location = Location
-- If Kind is "#included-from", we need to swap around the
-- enclosure and the diagnostic-line Path/Location details, in
-- order to squeeze maximum coherent information into minimal
-- report space.
if BuildItem.EnclosureKind == "#included-from" then
Report.EnclosureThingy
= string.format("%s:%s", Path, Location)
Report.EnclosurePath = Path
end
-- If EnclosureThingy is nil, we have a file-level diagnostic
-- without an introductory BuildItem/Enclosure statement. In
-- this case, fudge the file name and line number in as the
-- Thingy (and use "At" as the EnclosureKind). Otherwise, the
-- report generation crashes, as it always expects these fields
-- to be present.
if not Report.EnclosureThingy then
Report.EnclosureKind = "At"
Report.EnclosureThingy = Location
Report.EnclosurePath = Path
Report.Location = nil
end
-- Fill out details captured by the pattern match.
Report.Captures = BuildItem.Captures
-- Handle diagnostics that are spread across multiple lines;
-- indent them a little, for clarity.
if BuildItem.AddLines then
local t = {}
for i = 1, BuildItem.AddLines do
t[#t + 1] = Paragraph[BuildItem.ScanLineNr + i]
end
Report.ExtraLines = " "
.. table.concat(t, "\n ")
end
-- Check whether this filename and/or directory is blacklisted,
-- and, if so, add this report to the blacklist item's tally.
RecordDetailedReport = true
for _, BlacklistItem in ipairs(gcc.Blacklist) do
local Pattern
Pattern = BlacklistItem[1]
if Report.RelativeFilename:match(Pattern) then
BlacklistItem[2] = BlacklistItem[2] + 1
RecordDetailedReport = false
break
end
end
-- Add this report to the list of diagnostics matching this
-- template.
if RecordDetailedReport then
ReportList = Compiler.ReportArray[BuildItem.DiagnosticNr]
ReportList[#ReportList + 1] = Report
end
-- Finally, increase line number to step over all lines
-- covered by this diagnostic report.
AddLines = BuildItem.AddLines or 1
BuildItem.NextLineNr = BuildItem.ScanLineNr + AddLines
end
------------------------------------------------------------------------
--- Test one line of build output against all compiler template lines,
-- looking to find and collate context/info/note/warning/error messages
-- as appropriate
-- @tparam table Compiler Compiler-related diagnostics and templates.
-- @tparam array Paragraph Table containing one compiler invocation,
-- with the whole invocation collected into a paragraph, and with each
-- line of the output in a separate array element.
local function ScanLine(Compiler, Paragraph)
local BuildItem
local Line
local FoundPattern
-- Provide a shorthand name for detailed compiler state.
BuildItem = Compiler.BuildItem
FoundPattern = false
Line = Paragraph[BuildItem.ScanLineNr]
for DiagnosticNr, Diagnostic in ipairs(Compiler.Diagnostics) do
local Dummy
local Subs
local Captures
-- Try ASCII pattern match, and if that fails, try
-- UTF-8 pattern match.
Dummy, Subs = Line:gsub(Diagnostic.Pattern[1],
function (...)
Captures = {...} end)
if Subs == 0 and Diagnostic.Pattern[2] then
Dummy, Subs = Line:gsub(Diagnostic.Pattern[2],
function (...)
Captures = {...} end)
end
-- Did we match anything?
if Subs ~= 0 then
-- Yes, analyse it. The result will probably be
-- either that we record the enclosing {filename
-- plus function/template/macro/whatever} in the
-- context for later use, or that we generate a
-- report item for the given diagnostic.
BuildItem.Line = Line
BuildItem.DiagnosticNr = DiagnosticNr
BuildItem.Diagnostic = Diagnostic
BuildItem.Captures = Captures
AnalyseCapture(Compiler, Paragraph)
FoundPattern = true
break
end
end
-- We might have stumbled over a diagnostic message not in our
-- list. Look here for this case, and, if found, add it to a
-- list that we can report at the end.
-- (E.g. "...: warning: ... [-Wwarning-option-name]".)
if not FoundPattern then
BuildItem.NextLineNr = BuildItem.ScanLineNr + 1
if Line:match(": warning: .*%[%-W[^]]*%]$") then
local ReviewLines = Compiler.ReviewLines
ReviewLines[#ReviewLines + 1] = Line
end
end
end
------------------------------------------------------------------------
--- Analyse gcc output, scanning for warning/error messages, plus
-- associated information about the message's context (if available),
-- and compiling lists of errors, sorted by category.
local function AnalyseParagraph(Compiler, Paragraph)
local BuildItem
local RelativePath
local Filename
local i
-- Provide a shorthand name for detailed compiler state.
BuildItem = Compiler.BuildItem
RelativePath, Filename =
Paragraph[1]:match(" CWD: '(.-)'.*Compiling: '(.*)'$")
if RelativePath then
-- Remove any leading "./" item from the filename, as
-- this can derail blacklist path matching.
if Filename:match("^%./") then
Filename = Filename:sub(3)
end
-- Update compiler's path/filename context, if found
BuildItem.RelativePath = RelativePath
BuildItem.Filename = Filename
BuildItem.RelativeFilename =
RelativePath .. "/" .. Filename
end
-- Work through paragraph, which may include error report(s),
-- trying to make sense of non-trivial fault output layout(s).
-- We start from a flattened, simple list of template
-- info/warning/error lines, which pick out all messages
-- of interest, and then use markers and/or heuristics to
-- (crudely, partially)- reassemble the hierarchy.
i = 1
BuildItem.NextLineNr = 0
while i <= #Paragraph do
BuildItem.ScanLineNr = i
ScanLine(Compiler, Paragraph)
i = BuildItem.NextLineNr
end
end
------------------------------------------------------------------------
--- Work through all of the diagnostics collected by the analysis, and
-- use a very short, one-liner format for diagnostics where no instances
-- were found in the build output.
-- @tparam table Compiler Compiler context, with diagnostics template
-- and lists of reports found for each diagnostic.
local function ReportCleanDiagnostics(Compiler)
local HeaderIndent
-- Loop through all diagnostics, and use a header and
-- indentation to distinguish the list.
HeaderIndent = "* No diagnostics for:\n "
for i = 2, #Compiler.Diagnostics do
local ReportList = Compiler.ReportArray[i]
if ReportList and #ReportList == 0 then
printf("%s", HeaderIndent)
HeaderIndent = "\n "
printf("%s", Compiler.Diagnostics[i].Template)
end
end
printf("\n(End of list.)\n")
end
------------------------------------------------------------------------
--- Work through all of the diagnostics collected by the analysis, and
-- use a very short, one-liner format for diagnostics where no instances
-- were found in the build output.
-- @tparam table Compiler Compiler context, with blacklist list of
-- {"Pattern, Tally}" pairs.
local function ReportBlacklistDetails(Compiler)
local TotalItems
local HeaderIndent
TotalItems = 0
for _, Item in ipairs(Compiler.Blacklist) do
local Pattern = Item[1]
local Tally = Item[2]
TotalItems = TotalItems + Tally
end
if TotalItems == 0 then
print("(no blacklist items found)")
return
end
-- Loop through all diagnostics, and use a header and
-- indentation to distinguish the list.
HeaderIndent = [[
* Warning diagnostics suppressed by blacklist patterns:
Tally Pattern
----- -------
]]
for _, Item in ipairs(Compiler.Blacklist) do
local Pattern = Item[1]
local Tally = Item[2]
printf("%s%5d %5s", HeaderIndent, Tally, Pattern)
HeaderIndent = "\n "
end
printf("\n(End of list.)\n\n")
end
------------------------------------------------------------------------
local function ReportSingleDiagnosticList(Compiler, i)
printf("\n\n%s:\n", gcc.Diagnostics[i].Template)
for _, Report in ipairs(gcc.ReportArray[i]) do
printf(" %s:", Report.EnclosurePath)
if Report.Location then
printf("%s:", Report.Location)
end
printf("[%s:%s]: ",
Report.EnclosureKind,
Report.EnclosureThingy)
for j, Capture in ipairs(Report.Captures) do
printf(" %s", Capture)
end
printf("\n")
if Report.ExtraLines then
print(Report.ExtraLines)
end
end
end
------------------------------------------------------------------------
local function ReportReviewLines(Compiler)
local HeaderIndent
-- Is the list of potential-diagnostic lines empty?
if #Compiler.ReviewLines == 0 then
-- Yes, skip this output section entirely.
return
end
-- Loop through all diagnostics, and use a header and
-- indentation to distinguish the list.
HeaderIndent =
"\n* Lines that look like diagnostics, but we're not sure:\n "
for _, Line in ipairs(Compiler.ReviewLines) do
printf("%s", HeaderIndent)
HeaderIndent = "\n "
printf("%s", Line)
end
printf("\n(End of list.)\n")
end
------------------------------------------------------------------------
-- Demand that the program have one argument -- the make output file.
if #Args ~= 1 then
Usage(2)
end
if #arg ~= 1 then
Usage(0x42)
end
-- Prepare pattern-matching and message-category-labelling arrays
-- from the raw template text slab.
SplitRawTemplateText(gcc)
--DebugShowDiagnostics(gcc)
-- Read the make output into a table, organised into paragraphs.
local Paragraphs = ReadFileParagraphs(arg[1])
--[[
for i, Paragraph in ipairs(Paragraphs) do
DebugShowParagraph(Paragraph, i, " ")
end
--]]
-- Prepare to collate messages by type as the primary grouping.
gcc.ReportArray = {}
for i = 1, #gcc.Diagnostics do
gcc.ReportArray[i] = {}
end
-- Context about the item being compiled can flow across paragraphs,
-- so maintain it in the compiler state.
gcc.BuildItem = {
RelativePath = "(no path set yet)",
Filename = "(no filename found yet)"
}
--os.exit(0x42)
-- Run through all paragraphs, and where gcc is called (second line
-- exists, and begins with "gcc " or "g++ "), hand over the paragraph
-- to AnalyseGCCOutput for closer inspection.
for i, Paragraph in ipairs(Paragraphs) do
AnalyseParagraph(gcc, Paragraph)
end
-- Remove entries where we matched the line merely in order to capture
-- filename and function/macro/global/constructor/whatever scope for a
-- future report; any relevant information has now been transferred
-- across, so we don't want these meta-capture lines included in the
-- output. Note that assigning "nil" potentially pokes holes in the
-- array structure (unless it's strictly at the end of the array), so
-- iteration should not depend on ReportArray after this paragraph.
-- However, we need to keep 1:1:1 mapping of templates/patterns/reports.
for i, Diagnostic in ipairs(gcc.Diagnostics) do
if Diagnostic.Template:match("<ENCLOSURE>") then
gcc.ReportArray[i] = nil
end
end
------------------------------------------------------------------------
-- End of analysis. Now over to reporting results. --
------------------------------------------------------------------------
-- A facility to explicitly blacklist files and/or directories is
-- included, because some third-party code is present that immutable,
-- regardless of defects found. These defects typically come from
-- the perfect storm of two forces:
-- 1. A snapshot of a library was taken at some time, and change
-- is problematic due to interfacing issues, or in some cases
-- due to a license change that sees a library that was
-- formerly free (Libre), into a closed (proprietary) -roject.
-- While the free code is still available, and people can
-- (and have) forked projects to continue a Free/Libre
-- version, the risks of change outweigh the benefits; and
-- 2. The compiler toolchains (notably GCC), have grown
-- significantly stronger at tracing code flow, and finding
-- and reporting potential defective, or perhaps
-- defect-vulnerable code patterns.
ReportBlacklistDetails(gcc)
-- Code is often quite clean, so many diagnostics have no entries. Use
-- a function to show all these cases, so that the client knows about
-- the patterns we are searching for. The code has gone through a
-- couple of torturous rewrites, so it's possible that it has bugs.
-- These "believed clean" reports may help in that case.
ReportCleanDiagnostics(gcc)
ReportReviewLines(gcc)
-- Work through diagnostics in template order, outputting any errors
-- associated with that diagnostic in a terse list.
for i = 2, #gcc.Diagnostics do
local ReportList = gcc.ReportArray[i]
-- Is this diagnostic used for human-readable reports, rather
-- than for internal context collection?
if ReportList and #ReportList > 0 then
-- Yes, generate report for collated messages (if any)
ReportSingleDiagnosticList(gcc, i)
end
end
-- vim: set ts=8 et sw=8:
#!/bin/bash
# report_build_item: Show a summary of next build step, but give more
# context, especially file paths, than the previous tecmake.mak code.
# Current directory (PWD) and MAKELEVEL are maintained by GNU Make.
# Typical usage in Makefile (e.g. via tecmake.mak):
#$(OBJDIR)/%.o: $(SRCDIR)/%.c
# @$(REPORT_RELATIVE_PATH) $<
# $(ECHO)$(CC) -c $(CFLAGS) -o $@ $<
# @copyright (C) 2020 Grouse Software
# @license Permissive (MIT) license [see file LICENSE].
# @author sur-behoffski, mailto:<sur-behoff...@grouse.com.au>
#-----------------------------------------------------------------------
# Give the parameters descriptive names.
TargetDir="$PWD"
Level="$MAKELEVEL"
Makefile="$1"
FullTarget="$2"
# If FullTarget begins with "./", remove it.
FullTarget="${FullTarget#./}"
# Create a pattern to pick off the last "Level" path components.
Subst=""
for i in $( seq $(($Level - 2)) ) ; do
Subst="${Subst}[^/]*/"
done
Subst="${Subst}.*$"
Relpath="$( echo "$TargetDir" | sed -E "s:.*/(${Subst}):\1:" )"
echo ""
echo "[${Makefile}] CWD: '${Relpath}'; Compiling: '${FullTarget}'"
Index: Makefile
===================================================================
--- Makefile (revision 5620)
+++ Makefile (working copy)
@@ -6,6 +6,12 @@
TARGETS := $(filter-out $(EXCLUDE_TARGETS), $(TARGETS))
OTHERDEPENDENCIES := iupgtk iupmot
+# Add a facility to report directory paths as well as filenames when
+# invoking GCC. This opens the door for improved analysis of
+# diagnostics, notably allowing warnings to be triaged, e.g.
+# suppressing warnings from third-party libraries that have been frozen.
+export REPORT_BUILD_ITEM = "$(CURDIR)/report-build-item"
+
.PHONY: do_all $(TARGETS) $(OTHERDEPENDENCIES)
do_all: $(TARGETS)
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users