Skip to content

Fix compiler warnings#23

Merged
roblillack merged 1 commit into
mainfrom
fix-compiler-warnings
May 26, 2026
Merged

Fix compiler warnings#23
roblillack merged 1 commit into
mainfrom
fix-compiler-warnings

Conversation

@roblillack

Copy link
Copy Markdown
Owner

The build produced >100 warnings across the tree, dominated by undefined-behavior
casts, K&R-style function declarations, and a deprecated X11 API. This PR fixed that:

Pointer/int casts (-Wpointer-to-int-cast, -Wvoid-pointer-to-int-cast)

  • FSBrowser.c, FSPathView.c: drop bogus assert((int)ptr) casts that
    truncate on 64-bit; the assertion only needs the pointer.
  • FSBrowser.c, FSFinder.c, FSPanel.c, extnInspector.c: route
    WMGetNotificationClientData(...) through intptr_t before narrowing to
    int.

Switch coverage (-Wswitch)

  • FSBrowser.c, FSPathView.c: add WSDecrementWheel / WSIncrementWheel
    cases (no-op, matching the existing WSKnobSlot / WSNoPart arm).
  • FSFileView.c: handle FileLink in FSUpdateFileViewPath; treated like
    FileCopy since it introduces a new entry into the view.

Missing prototypes (-Wdeprecated-non-prototype)

  • FSUtils.h: give FSUpdateFileView a real prototype (was ()).
  • magic.c, regexp/regexp.c, regexp/regsub.c, regexp/regerror.c,
    regexp/regexp.h: convert all K&R declarations and definitions to ANSI
    prototypes. Pure mechanical rewrite; no behavior change.

Misc

  • FSFileView.c: drop extraneous parens in if ((x == y))
    (-Wparentheses-equality).
  • FSUtils.c: replace WMColor* with an RColor literal in the call to
    WMCreateBlendedPixmapFromFile, which actually takes const RColor*
    (-Wincompatible-pointer-types).
  • FSPanel.c: replace if (txt != ICONDIR) pointer-literal compare with an
    explicit "allocated" flag (-Wstring-compare).
  • xmodifier.c: replace deprecated XKeycodeToKeysym with
    XkbKeycodeToKeysym (-Wdeprecated-declarations).

@roblillack roblillack merged commit 0509e82 into main May 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant