Skip to content

Enforce -Wall -Werror across PSP and host builds - #78

Open
fjtrujy wants to merge 1 commit into
masterfrom
chore/wall-werror-warning-cleanup
Open

fjtrujy wants to merge 1 commit into
masterfrom
chore/wall-werror-warning-cleanup

Conversation

@fjtrujy

@fjtrujy fjtrujy commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Enforce -Wall -Werror directly in the compiler flags of all 26 component Makefiles, for PSP and host targets alike.

Fix the diagnostics exposed by strict builds without globally suppressing warnings:

  • Replace deprecated, unbounded sprintf usage with bounded formatting in pspsh, and ensure shell prompts reserve room for their > suffix (including on Cygwin GCC).
  • Correct VFPU disassembler output-buffer advancement and add golden-output regression coverage for vrot formatting.
  • Repair usbhostfs_pc compiler issues and host-side robustness: validate credential restoration and drive paths, handle checked return values and writes, scope UID-related variables, and pass unsigned characters to ctype routines.
  • Fix PSP format-specifier and non-returning-exit diagnostics, add the missing ttylink string header, and make the reboot hook extraction deterministic.
  • Link tools/webget against curl's required mbedTLS libraries.

Verification

Known optional / legacy targets

The warning policy is present in their Makefiles, but not every standalone target is fully link-tested: Linux-only RemoteJoy PC requires <linux/joystick.h>; RemoteJoy PC SDL requires legacy SDL 1.x / sdl-config; standalone usbshell still references PSPLink-internal symbols. These existing platform/dependency/link-integration limitations are outside this warning-cleanup PR. The webget strict compile and link were verified after adding mbedTLS libraries.

This change has not been deployed to real PSP hardware and has not replaced or restarted the running Mac USB daemon.

Set -Wall -Werror directly in each of the 26 target Makefiles, rather than using a shared include. Fix PSP and host compiler diagnostics, preserve bounded formatting and privilege/path checks, and correct the VFPU rotator disassembler output with regression coverage. Document platform-specific legacy build requirements.
@fjtrujy
fjtrujy force-pushed the chore/wall-werror-warning-cleanup branch from a9d430f to 1500a14 Compare November 3, 2026 10:24
@rofl0r

rofl0r commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

it would be preferable if the -Werror is only passed for CI builds, else almost anyone trying to compile this on a configuration that's been untested so far (other compiler versions, other host libc versions, etc) will run into build errors. i'd suggest changing the makefiles to assemble CFLAGS from the usual required options, plus a WARNFLAGS macro that can be passed on the command line: make WARNFLAGS="-Werror" and in the Makefiles CFLAGS = -fwhatever $(WARNFLAGS). that would allow to use the dragonic WARNFLAGS during CI, but regular users can opt out by not setting it.

@fjtrujy

fjtrujy commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

it would be preferable if the -Werror is only passed for CI builds, else almost anyone trying to compile this on a configuration that's been untested so far (other compiler versions, other host libc versions, etc) will run into build errors. i'd suggest changing the makefiles to assemble CFLAGS from the usual required options, plus a WARNFLAGS macro that can be passed on the command line: make WARNFLAGS="-Werror" and in the Makefiles CFLAGS = -fwhatever $(WARNFLAGS). that would allow to use the dragonic WARNFLAGS during CI, but regular users can opt out by not setting it.

What I can do to cover such scenarios is to add a new flag to make it easy to compile, like make WERROR=0.

@sharkwouter

sharkwouter commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

What I can do to cover such scenarios is to add a new flag to make it easy to compile, like make WERROR=0.

Sounds like a good idea. Alternatively, you can also look at the CI environment variable. That one is set in the GitHub CI.

This branch has not been deployed

No deployments
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.

3 participants