[tlbuild] dvi test?

Bruno Voisin bvoisin at icloud.com
Sun Jan 30 00:59:13 CET 2022


Following up on Nelson Beebe's suggestion,

> [...] recent gcc (12) and clang (11, 12,
> 13) compilers have new options that can ensure that local variables
> are initialized, rather than having unpredictable values from the last
> occupant of their stack positions:
> 
> 	-ftrivial-auto-var-init=[uninitialized|pattern|zero]
> 
> This option probes areas of the C language where behavior is
> implementation defined, or undefined:
> 
> 	-fsanitize=undefined
> 
> Other possibly useful options are:
> 
> 	-Werror
> 	-Wextra
> 	-Wno-unused-variable
> 	-Wshadow=global
> 	-Wshadow=local
> 	-Wuninitialized


I tried all these options on macOS 12.3 Monterey Beta on an ARM Mac (M1 chip) with the Command Line Tools 12.2, so that

	% clang --version
	Apple clang version 13.0.0 (clang-1300.0.29.30)
	Target: arm64-apple-darwin21.4.0
	Thread model: posix
	InstalledDir: /Library/Developer/CommandLineTools/usr/bin

I followed Karl's suggested procedure, namely, after creating a test directory and moving to it:

	rsync -a --delete --exclude=.svn --exclude=Work \
	      tug.org::tldevsrc/Build/source/ .

	mkdir Work && cd Work

	../configure --disable-all-pkgs --enable-xdvik \
	  -C CFLAGS="-g -ftrivial-auto-var-init=pattern" \
	  CXXFLAGS="-g -ftrivial-auto-var-init=pattern" >&outc || echo fail

	make >&outm || echo fail

	cd texk/xdvik
	make check

	env TEXMFROOT=/usr/local/texlive/2021 \
	    TEXMFCNF=/usr/local/texlive/2021/texmf-dist/web2c \
	    ./xdvi-bin ~/Desktop/Temp/TeX/t2a.dvi

When testing the -W options, I removed the ">&outm || echo fail" part so as to be able to inspect the warnings.

In some cases "make distclean" did not work, so I ended up deleting the Work directory between each successive option test.

The detailed outcome option by option follows.

Bruno Voisin


-ftrivial-auto-var-init=pattern
===============================

configure and make succeed, make check succeeds, and xdvi crashes the same as before:

Warning: locale not supported by Xlib, locale set to C
Warning: Unable to load any usable fontset
xdvi-bin: set_no_char: attempt to set character of unknown font, offset 42
xdvi-bin 22.87.04 (Xaw toolkit): ../../../texk/xdvik/dvi-draw.c:488: Shouldn't happen: I'll abort now, to help you debugging this.
zsh: abort      env TEXMFROOT=/usr/local/texlive/2021  ./xdvi-bin ~/Desktop/Temp/TeX/t2a.dvi


-ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
=====================================================================================================

Same.


-fsanitize=undefined
====================

Same, but the crash message is more detailed

Warning: locale not supported by Xlib, locale set to C
Warning: Unable to load any usable fontset
../../../texk/xdvik/dvi-draw.c:458:9: runtime error: left shift of negative value -3
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../texk/xdvik/dvi-draw.c:458:9 in 
../../../texk/xdvik/ft.c:184:35: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../texk/xdvik/ft.c:184:35 in 
xdvi-bin: set_no_char: attempt to set character of unknown font, offset 42
xdvi-bin 22.87.04 (Xaw toolkit): ../../../texk/xdvik/dvi-draw.c:488: Shouldn't happen: I'll abort now, to help you debugging this.
zsh: abort      env TEXMFROOT=/usr/local/texlive/2021  ./xdvi-bin ~/Desktop/Temp/TeX/t2a.dvi


-Werror
=======

make fails with

=== configuring in native (/Users/brunovoisin/Desktop/MacTeX-2022/texlive/source/Work/libs/luajit/native)
configure: running /bin/sh ../../../../libs/luajit/native/configure --disable-option-checking '--prefix=/usr/local'  '--disable-all-pkgs' '--enable-xdvik' 'CFLAGS=-g -Werror' 'CXXFLAGS=-g -Werror' '--enable-native-texlive-build' '--enable-largefile' '--disable-silent-rules' '--enable-multiplatform=yes' '--enable-cxx-runtime-hack=yes' '--enable-libtool-hack=yes' '--disable-shared' '--enable-texlive-build' '--bindir=${exec_prefix}/bin/aarch64-apple-darwin21.4.0' '--libdir=${exec_prefix}/lib/aarch64-apple-darwin21.4.0' '--with-x' '--enable-autosp=no' '--enable-axodraw2=no' '--enable-devnag=no' '--enable-lacheck=no' '--enable-m-tx=no' '--enable-pmx=no' '--enable-ps2eps=no' '--enable-t1utils=no' '--enable-texdoctk=no' '--enable-tpic2pdftex=no' '--enable-vlna=no' '--enable-xindy=no' '--with-clisp-runtime=default' '--enable-xml2pmx=no' '--enable-xpdfopen=no' '--enable-web2c=no' '--enable-afm2pl=no' '--enable-bibtex-x=no' '--enable-chktex=no' '--enable-cjkutils=no' '--enable-detex=no' '--enable-dtl=no' '--enable-dvi2tty=no' '--enable-dvidvi=no' '--enable-dviljk=no' '--enable-dviout-util=no' '--enable-dvipdfm-x=no' '--enable-dvipng=no' '--enable-dvipos=no' '--enable-dvipsk=no' '--enable-dvisvgm=no' '--enable-gregorio=no' '--enable-gsftopk=no' '--enable-lcdf-typetools=no' '--enable-makeindexk=no' '--enable-makejvf=no' '--enable-mendexk=no' '--enable-musixtnt=no' '--enable-ps2pk=no' '--enable-psutils=no' '--enable-seetexk=no' '--enable-tex4htk=no' '--enable-ttf2pk2=no' '--enable-ttfdump=no' '--enable-upmendex=no' '--enable-texlive=no' '--with-system-harfbuzz=no' '--with-system-icu=no' '--with-system-teckit=no' '--with-system-graphite2=no' '--with-system-zziplib=no' '--with-system-xpdf=no' '--with-system-mpfr=no' '--with-system-gmp=no' '--with-system-cairo=no' '--with-system-pixman=no' '--with-system-gd=no' '--with-system-freetype2=no' '--with-system-libpng=no' '--with-system-libpaper=no' '--with-system-zlib=no' '--with-system-ptexenc=no' '--with-system-kpathsea=no' '--datarootdir=${prefix}' '--mandir=${prefix}/texmf-dist/doc/man' '--infodir=${prefix}/texmf-dist/doc/info' '--disable-build' 'HOST_PTR_SIZE=8' 'DASM_ARCH=arm64' --cache-file=../../../config.cache --srcdir=../../../../libs/luajit/native
configure: loading cache ../../../config.cache
checking for a BSD-compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... ../../../../libs/luajit/native/../../../build-aux/install-sh -c -d
checking for gawk... (cached) awk
checking whether make sets $(MAKE)... (cached) yes
checking whether make supports nested variables... (cached) yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... (cached) gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... (cached) o
checking whether the compiler supports GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to enable C11 features... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether the compiler accepts prototypes... (cached) yes
checking what warning flags to pass to the C compiler... (cached) -Wimplicit -Wreturn-type
checking for gcc... (cached) gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to enable C11 features... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking whether ln -s works... yes
checking for stdio.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking size of void *... (cached) 8
checking build system type... (cached) aarch64-apple-darwin21.4.0
checking host system type... (cached) aarch64-apple-darwin21.4.0
checking for library containing pow... (cached) no
configure: error: Sorry, did not find pow()
configure: error: ../../../../libs/luajit/native/configure failed for native
=== configuring in luajit failed
make[2]: *** [recurse] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1


-Wextra
=======

The issued warnings are

../../../texk/kpathsea/kpsewhich.c:509:24: warning: unused parameter 'kpse' [-Wunused-parameter]
help_message (kpathsea kpse, string *argv)
                       ^
../../../texk/kpathsea/kpsewhich.c:541:16: warning: comparison of integers of different signs: 'int' and 'kpse_file_format_type' [-Wsign-compare]
         if (f == format_abbrs[a].format) {
             ~ ^  ~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.

../../../texk/kpathsea/dir.c:30:26: warning: unused parameter 'kpse' [-Wunused-parameter]
kpathsea_dir_p (kpathsea kpse, string fn)
                         ^
1 warning generated.

../../../texk/kpathsea/getopt.c:323:43: warning: unused parameter 'argc' [-Wunused-parameter]
static const char *_getopt_initialize(int argc, char *const *argv, const char *optstring)
                                          ^
../../../texk/kpathsea/getopt.c:323:62: warning: unused parameter 'argv' [-Wunused-parameter]
static const char *_getopt_initialize(int argc, char *const *argv, const char *optstring)
                                                             ^
2 warnings generated.

../../../texk/xdvik/events.c:3741:12: warning: unused parameter 'params' [-Wunused-parameter]
          String *params, Cardinal *num_params)
                  ^
../../../texk/xdvik/events.c:3741:30: warning: unused parameter 'num_params' [-Wunused-parameter]
          String *params, Cardinal *num_params)
                                    ^
../../../texk/xdvik/events.c:3968:22: warning: unused parameter 'w' [-Wunused-parameter]
Act_user_exec(Widget w, XEvent *event,
                     ^
../../../texk/xdvik/events.c:3968:33: warning: unused parameter 'event' [-Wunused-parameter]
Act_user_exec(Widget w, XEvent *event,
                                ^
../../../texk/xdvik/events.c:4084:29: warning: operator '?:' has lower precedence than '|'; '|' will be evaluated first [-Wbitwise-conditional-parentheses]
                                      | BROKEN_RECONFIG ? 0 : XPRT_SHOW_SCROLLBARS | XPRT_SHOW_BUTTONS
                                      ~~~~~~~~~~~~~~~~~ ^
../../../texk/xdvik/events.c:4084:29: note: place parentheses around the '|' expression to silence this warning
                                      | BROKEN_RECONFIG ? 0 : XPRT_SHOW_SCROLLBARS | XPRT_SHOW_BUTTONS
                                      ~~~~~~~~~~~~~~~~~ ^
../../../texk/xdvik/events.c:4084:29: note: place parentheses around the '?:' expression to evaluate it first
                                      | BROKEN_RECONFIG ? 0 : XPRT_SHOW_SCROLLBARS | XPRT_SHOW_BUTTONS
                                        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 warnings generated.

../../../texk/xdvik/font-open.c:157:14: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
            if (len < ffline_len - 1)
                ~~~ ^ ~~~~~~~~~~~~~~
../../../texk/xdvik/font-open.c:1281:35: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
                if (t1p != NULL && t1p->key_len == len
                                   ~~~~~~~~~~~~ ^  ~~~
2 warnings generated.

../../../texk/xdvik/ft.c:107:29: warning: unused parameter 'stream' [-Wunused-parameter]
xdvi_stream_close(FT_Stream stream)
                            ^
1 warning generated.

../../../texk/xdvik/psgs.c:863:17: warning: unused parameter 'in_header' [-Wunused-parameter]
checkgs(Boolean in_header)
                ^
1 warning generated.

../../../texk/xdvik/x_util.c:335:10: warning: comparison of integers of different signs: 'long' and 'Window' (aka 'unsigned long') [-Wsign-compare]
        if (*wp == w) { /* match, remove our ID */
            ~~~ ^  ~
1 warning generated.

../../../texk/xdvik/gui/pagesel.c:541:32: warning: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
    XawListChange(LIST_WIDGET, page_info.page_labels, 0,
                               ^~~~~~~~~~~~~~~~~~~~~
/usr/X11/include/X11/Xaw/List.h:170:18: note: passing argument to parameter 'list' here
 _Xconst char           **list,
                          ^
1 warning generated.

../../../texk/xdvik/gui/print-dialog.c:1909:9: warning: cast to smaller integer type 'pageRadioT' (aka 'enum pageRadioT_') from 'XtPointer' (aka 'void *') [-Wvoid-pointer-to-enum-cast]
        return (pageRadioT)XawToggleGetCurrent(radio_all);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../texk/xdvik/gui/print-dialog.c:2311:15: warning: cast to smaller integer type 'pageRadioT' (aka 'enum pageRadioT_') from 'XtPointer' (aka 'void *') [-Wvoid-pointer-to-enum-cast]
        value_curr = (pageRadioT)XawToggleGetCurrent(radio_all);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.


-Wno-unused-variable
====================

The issued warnings are

../../../texk/xdvik/events.c:4084:29: warning: operator '?:' has lower precedence than '|'; '|' will be evaluated first [-Wbitwise-conditional-parentheses]
                                      | BROKEN_RECONFIG ? 0 : XPRT_SHOW_SCROLLBARS | XPRT_SHOW_BUTTONS
                                      ~~~~~~~~~~~~~~~~~ ^
../../../texk/xdvik/events.c:4084:29: note: place parentheses around the '|' expression to silence this warning
                                      | BROKEN_RECONFIG ? 0 : XPRT_SHOW_SCROLLBARS | XPRT_SHOW_BUTTONS
                                      ~~~~~~~~~~~~~~~~~ ^
../../../texk/xdvik/events.c:4084:29: note: place parentheses around the '?:' expression to evaluate it first
                                      | BROKEN_RECONFIG ? 0 : XPRT_SHOW_SCROLLBARS | XPRT_SHOW_BUTTONS
                                        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

../../../texk/xdvik/gui/pagesel.c:541:32: warning: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
    XawListChange(LIST_WIDGET, page_info.page_labels, 0,
                               ^~~~~~~~~~~~~~~~~~~~~
/usr/X11/include/X11/Xaw/List.h:170:18: note: passing argument to parameter 'list' here
 _Xconst char           **list,
                          ^
1 warning generated.

../../../texk/xdvik/gui/print-dialog.c:1909:9: warning: cast to smaller integer type 'pageRadioT' (aka 'enum pageRadioT_') from 'XtPointer' (aka 'void *') [-Wvoid-pointer-to-enum-cast]
        return (pageRadioT)XawToggleGetCurrent(radio_all);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../texk/xdvik/gui/print-dialog.c:2311:15: warning: cast to smaller integer type 'pageRadioT' (aka 'enum pageRadioT_') from 'XtPointer' (aka 'void *') [-Wvoid-pointer-to-enum-cast]
        value_curr = (pageRadioT)XawToggleGetCurrent(radio_all);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.


-Wshadow-all
============

-Wshadow=global and -Wshadow=local don't seem to exist with this clang. I switched to -Wshadow-all, giving

../../../texk/xdvik/dvi-draw.c:2378:48: warning: declaration shadows a variable in the global scope [-Wshadow]
get_unicode_char(wide_ubyte ch, struct drawinf currinf, char *retbuf)
                                               ^
../../../texk/xdvik/dvi-draw.c:126:16: note: previous declaration is here
struct drawinf currinf;
               ^
../../../texk/xdvik/dvi-draw.c:2642:17: warning: declaration shadows a variable in the global scope [-Wshadow]
        struct drawinf currinf,
                       ^
../../../texk/xdvik/dvi-draw.c:126:16: note: previous declaration is here
struct drawinf currinf;
               ^
2 warnings generated.

../../../texk/xdvik/events.c:515:54: warning: declaration shadows a variable in the global scope [-Wshadow]
compile_action(const char *str, struct xdvi_action **app)
                                                     ^
../../../texk/xdvik/xdvi.h:800:21: note: previous declaration is here
extern XtAppContext app;
                    ^
../../../texk/xdvik/events.c:681:61: warning: declaration shadows a variable in the global scope [-Wshadow]
cached_compile_action(const char *str, struct xdvi_action **app)
                                                            ^
../../../texk/xdvik/xdvi.h:800:21: note: previous declaration is here
extern XtAppContext app;
                    ^
../../../texk/xdvik/events.c:4084:29: warning: operator '?:' has lower precedence than '|'; '|' will be evaluated first [-Wbitwise-conditional-parentheses]
                                      | BROKEN_RECONFIG ? 0 : XPRT_SHOW_SCROLLBARS | XPRT_SHOW_BUTTONS
                                      ~~~~~~~~~~~~~~~~~ ^
../../../texk/xdvik/events.c:4084:29: note: place parentheses around the '|' expression to silence this warning
                                      | BROKEN_RECONFIG ? 0 : XPRT_SHOW_SCROLLBARS | XPRT_SHOW_BUTTONS
                                      ~~~~~~~~~~~~~~~~~ ^
../../../texk/xdvik/events.c:4084:29: note: place parentheses around the '?:' expression to evaluate it first
                                      | BROKEN_RECONFIG ? 0 : XPRT_SHOW_SCROLLBARS | XPRT_SHOW_BUTTONS
                                        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../texk/xdvik/events.c:4980:30: warning: declaration shadows a variable in the global scope [-Wshadow]
XtAppAddTimeOut(XtAppContext app, unsigned long interval, XtTimerCallbackProc proc, XtPointer closure)
                             ^
../../../texk/xdvik/xdvi.h:800:21: note: previous declaration is here
extern XtAppContext app;
                    ^
4 warnings generated.

../../../texk/xdvik/hypertex.c:623:55: warning: declaration shadows a variable in the global scope [-Wshadow]
init_visited_links(struct visited_anchors *links, int total_pages, Boolean new_dvi_file)
                                                      ^
../../../texk/xdvik/xdvi.h:832:12: note: previous declaration is here
extern int total_pages;
           ^
../../../texk/xdvik/hypertex.c:712:38: warning: declaration shadows a variable in the global scope [-Wshadow]
push_stack(struct htex_anchor_stack *stack, htexAnchorT type, int anchor_num)
                                     ^
../../../texk/xdvik/hypertex.c:539:33: note: previous declaration is here
static struct htex_anchor_stack stack = { 0, 0, NULL };
                                ^
../../../texk/xdvik/hypertex.c:737:37: warning: declaration shadows a variable in the global scope [-Wshadow]
pop_stack(struct htex_anchor_stack *stack, int *anchor_num)
                                    ^
../../../texk/xdvik/hypertex.c:539:33: note: previous declaration is here
static struct htex_anchor_stack stack = { 0, 0, NULL };
                                ^
../../../texk/xdvik/hypertex.c:765:48: warning: declaration shadows a variable in the global scope [-Wshadow]
get_href_depth(const struct htex_anchor_stack *stack)
                                               ^
../../../texk/xdvik/hypertex.c:539:33: note: previous declaration is here
static struct htex_anchor_stack stack = { 0, 0, NULL };
                                ^
../../../texk/xdvik/hypertex.c:777:38: warning: declaration shadows a variable in the global scope [-Wshadow]
peek_stack(struct htex_anchor_stack *stack, int *anchor_num)
                                     ^
../../../texk/xdvik/hypertex.c:539:33: note: previous declaration is here
static struct htex_anchor_stack stack = { 0, 0, NULL };
                                ^
../../../texk/xdvik/hypertex.c:1574:45: warning: declaration shadows a variable in the global scope [-Wshadow]
history_save_anchor(const char *anchor, int current_page, const char *dvi_name)
                                            ^
../../../texk/xdvik/xdvi.h:831:12: note: previous declaration is here
extern int current_page;
           ^
6 warnings generated.

../../../texk/xdvik/print-internal.c:735:14: warning: declaration shadows a local variable [-Wshadow]
                    size_t i;
                           ^
../../../texk/xdvik/print-internal.c:698:9: note: previous declaration is here
    int i;
        ^
1 warning generated.

../../../texk/xdvik/special.c:1230:12: warning: declaration shadows a local variable [-Wshadow]
            char *argv[4];
                  ^
../../../texk/xdvik/special.c:1143:24: note: previous declaration is here
    static const char *argv[] = { NULL, "-c", NULL, NULL };
                       ^
1 warning generated.

../../../texk/xdvik/util.c:1566:15: warning: declaration shadows a variable in the global scope [-Wshadow]
        struct avl      **app;
                          ^
../../../texk/xdvik/xdvi.h:800:21: note: previous declaration is here
extern XtAppContext app;
                    ^
1 warning generated.

../../../texk/xdvik/xdvi.c:3535:7: warning: declaration shadows a local variable [-Wshadow]
        long data = XtWindow(globals.widgets.top_level);
             ^
../../../texk/xdvik/xdvi.c:3151:42: note: previous declaration is here
run_dvi_file(const char *filename, void *data)
                                         ^
1 warning generated.

../../../texk/xdvik/gui/help-window.c:155:23: warning: declaration shadows a variable in the global scope [-Wshadow]
init_item(const char *resource, const char **resource_default,
                      ^
../../../texk/xdvik/xdvi.h:615:3: note: previous declaration is here
} resource;
  ^
1 warning generated.

../../../texk/xdvik/gui/pagesel.c:360:23: warning: declaration shadows a variable in the global scope [-Wshadow]
pageinfo_allocate(int total_pages)
                      ^
../../../texk/xdvik/xdvi.h:832:12: note: previous declaration is here
extern int total_pages;
           ^
../../../texk/xdvik/gui/pagesel.c:541:32: warning: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
    XawListChange(LIST_WIDGET, page_info.page_labels, 0,
                               ^~~~~~~~~~~~~~~~~~~~~
/usr/X11/include/X11/Xaw/List.h:170:18: note: passing argument to parameter 'list' here
 _Xconst char           **list,
                          ^
2 warnings generated.

../../../texk/xdvik/gui/print-dialog.c:1909:9: warning: cast to smaller integer type 'pageRadioT' (aka 'enum pageRadioT_') from 'XtPointer' (aka 'void *') [-Wvoid-pointer-to-enum-cast]
        return (pageRadioT)XawToggleGetCurrent(radio_all);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../texk/xdvik/gui/print-dialog.c:2311:15: warning: cast to smaller integer type 'pageRadioT' (aka 'enum pageRadioT_') from 'XtPointer' (aka 'void *') [-Wvoid-pointer-to-enum-cast]
        value_curr = (pageRadioT)XawToggleGetCurrent(radio_all);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.

../../../texk/xdvik/gui/topic-window.c:489:18: warning: declaration shadows a variable in the global scope [-Wshadow]
    XtAppContext app = NULL;
                 ^
../../../texk/xdvik/xdvi.h:800:21: note: previous declaration is here
extern XtAppContext app;
                    ^
1 warning generated.

../../../texk/xdvik/gui/xaw_menu.c:609:33: warning: declaration shadows a variable in the global scope [-Wshadow]
SubMenuHandleEvent(XtAppContext app, XEvent *event)
                                ^
../../../texk/xdvik/xdvi.h:800:21: note: previous declaration is here
extern XtAppContext app;
                    ^
1 warning generated.


-Wundefined
===========

The issued warnings are

../../../texk/xdvik/events.c:4084:29: warning: operator '?:' has lower precedence than '|'; '|' will be evaluated first [-Wbitwise-conditional-parentheses]
                                      | BROKEN_RECONFIG ? 0 : XPRT_SHOW_SCROLLBARS | XPRT_SHOW_BUTTONS
                                      ~~~~~~~~~~~~~~~~~ ^
../../../texk/xdvik/events.c:4084:29: note: place parentheses around the '|' expression to silence this warning
                                      | BROKEN_RECONFIG ? 0 : XPRT_SHOW_SCROLLBARS | XPRT_SHOW_BUTTONS
                                      ~~~~~~~~~~~~~~~~~ ^
../../../texk/xdvik/events.c:4084:29: note: place parentheses around the '?:' expression to evaluate it first
                                      | BROKEN_RECONFIG ? 0 : XPRT_SHOW_SCROLLBARS | XPRT_SHOW_BUTTONS
                                        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

../../../texk/xdvik/gui/pagesel.c:541:32: warning: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
    XawListChange(LIST_WIDGET, page_info.page_labels, 0,
                               ^~~~~~~~~~~~~~~~~~~~~
/usr/X11/include/X11/Xaw/List.h:170:18: note: passing argument to parameter 'list' here
 _Xconst char           **list,
                          ^
../../../texk/xdvik/gui/pagesel.c:1044:9: warning: variable 'view_height' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
    if (viewport != NULL && XtIsRealized(viewport))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../texk/xdvik/gui/pagesel.c:1055:22: note: uninitialized use occurs here
    bot_y = view_y + view_height;
                     ^~~~~~~~~~~
../../../texk/xdvik/gui/pagesel.c:1044:5: note: remove the 'if' if its condition is always true
    if (viewport != NULL && XtIsRealized(viewport))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../texk/xdvik/gui/pagesel.c:1044:9: warning: variable 'view_height' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
    if (viewport != NULL && XtIsRealized(viewport))
        ^~~~~~~~~~~~~~~~
../../../texk/xdvik/gui/pagesel.c:1055:22: note: uninitialized use occurs here
    bot_y = view_y + view_height;
                     ^~~~~~~~~~~
../../../texk/xdvik/gui/pagesel.c:1044:9: note: remove the '&&' if its condition is always true
    if (viewport != NULL && XtIsRealized(viewport))
        ^~~~~~~~~~~~~~~~~~~
../../../texk/xdvik/gui/pagesel.c:1032:26: note: initialize the variable 'view_height' to silence this warning
    Dimension view_height, row_height, internal_height;
                         ^
                          = 0
3 warnings generated.

../../../texk/xdvik/gui/print-dialog.c:1909:9: warning: cast to smaller integer type 'pageRadioT' (aka 'enum pageRadioT_') from 'XtPointer' (aka 'void *') [-Wvoid-pointer-to-enum-cast]
        return (pageRadioT)XawToggleGetCurrent(radio_all);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../texk/xdvik/gui/print-dialog.c:2311:15: warning: cast to smaller integer type 'pageRadioT' (aka 'enum pageRadioT_') from 'XtPointer' (aka 'void *') [-Wvoid-pointer-to-enum-cast]
        value_curr = (pageRadioT)XawToggleGetCurrent(radio_all);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.




More information about the tlbuild mailing list.