Skip to content

Clang warning cleanup

Alan Coopersmith requested to merge alanc/xman:clang into master
  1. ScrollByL: move from XtOffset to XtOffsetOf

Clears 13 warnings from clang 13 of the form:

ScrollByL.c:67:6: warning: performing pointer subtraction with a null
 pointer has undefined behavior [-Wnull-pointer-subtraction]
     CoreOffset(width), XtRImmediate, (caddr_t) 500},
     ^~~~~~~~~~~~~~~~~
ScrollByL.c:63:27: note: expanded from macro 'CoreOffset'
#define CoreOffset(field) XtOffset(ScrollByLineWidget, core.field)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1. globals.c: include globals.h to validate global var declarations

Clears up 9 warnings from clang 13 of the form:

globals.c:34:16: warning: no previous extern declaration for non-static
 variable 'resources' [-Wmissing-variable-declarations]
Xman_Resources resources;       /* Resource manager sets these. */
              ^

Merge request reports

Loading