Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler warnings #45

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mtauraso
Copy link

@mtauraso mtauraso commented Apr 12, 2023

Adds utility functions to work around -Wall for common codebase idioms, and some small vscode integration

  • All Path writing been altered to use PATH_BUFSIZE (=1024) static buffers
  • MAXLENSTR has been relegated to a maximum length for a datafile line
  • Usages of sprintf for paths have all been run through pathprintf/pathappendprintf macros in util.h
  • Added a new util module to hold on to global error handling and termination issues.
  • Usages of fscanf/fgets where the return is not checked are routed through ufscanf/ufgets which check for catastrophic conditions. ufscanf on EOF will still pass through (just like calling fscanf)
  • Catastrophic conditions in the utility functions are handled by panic() which formats a message string and exits
  • Because the interface to util is preprocessor macros, all messages to panic have __FILE__ __LINE__ and __func__ preprocessor info to make troubleshooting easier

Adds utility functions to work around -Wall for common codebase idioms.
- All Path writing been altered to use PATH_BUFSIZE (=1024) static buffers
- Usages of sprintf for paths have all been run through
  pathprintf/pathappendprintf macros in util.h
- Added a new util module to hold on to global error handling and
  termination issues.
- Usages of fscanf/fgets where the return is not checked are routed
  through ufscanf/ufgets which check for catastrophic conditions.
  ufscanf on EOF will still pass through (just like calling fscanf)
- Catastrophic conditions in the utility functions are handled by panic()
  which formats a message string and exits
- Because the interface to util is preprocessor macros, all messages
  to panic have __FILE__ __LINE__ and __func__ information to make
  troubleshooting easier
@mtauraso
Copy link
Author

mtauraso commented Apr 12, 2023

This is in draft state because I haven't run the code extensively yet. It only builds at the moment.

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