Skip to content

Initialize arguments to main.#136

Merged
anacierdem merged 1 commit intoDragonMinded:trunkfrom
rasky:main_args2
Jun 13, 2021
Merged

Initialize arguments to main.#136
anacierdem merged 1 commit intoDragonMinded:trunkfrom
rasky:main_args2

Conversation

@rasky
Copy link
Collaborator

@rasky rasky commented Jun 13, 2021

In C, main can accept argc/argv arguments. On N64 these are meaningless,
but nonetheless, to help users write code portable between PC/N64, we
should probably set those arguments to something, otherwise they get
random values at boot. Let's try to set argc=0 / argv=NULL, which at
least should be compatible with most standard usages in C code
(including getopt) without crashing.

In C, main can accept argc/argv arguments. On N64 these are meaningless,
but nonetheless, to help users write code portable between PC/N64, we
should probably set those arguments to something, otherwise they get
random values at boot. Let's try to set argc=0 / argv=NULL, which at
least should be compatible with most standard usages in C code
(including getopt) without crashing.
@anacierdem anacierdem merged commit f0f8f09 into DragonMinded:trunk Jun 13, 2021
anacierdem added a commit to anacierdem/libdragon-docker that referenced this pull request Jul 27, 2021
Changed

- Improve fastpath of dfs_read (DragonMinded/libdragon#133)
- Refactor n64tool (DragonMinded/libdragon#153, DragonMinded/libdragon#155)

Fixed

- Zero-initialize the token array to avoid -Werror=maybe-uninitialized (DragonMinded/libdragon#134)
- Initialize arguments to main libdragon entrypoint (DragonMinded/libdragon#136)
- SD support fixes and dragonfs fopen fix (DragonMinded/libdragon#137)
- lib/include paths in tests Makefile (DragonMinded/libdragon#138)
- Reenable test_timer_ticks for emulators (DragonMinded/libdragon#140)
- n64tool: return error in case the seek offset required backward seek (DragonMinded/libdragon#144)
- Add missing extern "C" in debug.h (DragonMinded/libdragon#146)
- Ensure C++ global constructors are not garbage collected by ld (DragonMinded/libdragon#148)
- Fix clipped RDP rectangle drawing (DragonMinded/libdragon#147)

Added

- restart_timer and new_timer_stopped functions (DragonMinded/libdragon#131)
- dfs_rom_addr (DragonMinded/libdragon#133)
- Implement EEPROM Filesystem and test ROM (DragonMinded/libdragon#125)
- ed64romconfig binary (DragonMinded/libdragon#153, DragonMinded/libdragon#155)
- Support for RTC status/read/write commands (DragonMinded/libdragon#152)
anacierdem added a commit to anacierdem/libdragon-docker that referenced this pull request Jul 27, 2021
Changed

- Improve fastpath of dfs_read (DragonMinded/libdragon#133)
- Refactor n64tool (DragonMinded/libdragon#153, DragonMinded/libdragon#155)
  - It no longer support byte-swapping and only generates a z64 file.

Fixed

- Zero-initialize the token array to avoid -Werror=maybe-uninitialized (DragonMinded/libdragon#134)
- Initialize arguments to main libdragon entrypoint (DragonMinded/libdragon#136)
- SD support fixes and dragonfs fopen fix (DragonMinded/libdragon#137)
- lib/include paths in tests Makefile (DragonMinded/libdragon#138)
- Reenable test_timer_ticks for emulators (DragonMinded/libdragon#140)
- n64tool: return error in case the seek offset required backward seek (DragonMinded/libdragon#144)
- Add missing extern "C" in debug.h (DragonMinded/libdragon#146)
- Ensure C++ global constructors are not garbage collected by ld (DragonMinded/libdragon#148)
- Fix clipped RDP rectangle drawing (DragonMinded/libdragon#147)

Added

- restart_timer and new_timer_stopped functions (DragonMinded/libdragon#131)
- dfs_rom_addr (DragonMinded/libdragon#133)
- Implement EEPROM Filesystem and test ROM (DragonMinded/libdragon#125)
- ed64romconfig binary (DragonMinded/libdragon#153, DragonMinded/libdragon#155)
- Support for RTC status/read/write commands (DragonMinded/libdragon#152)
anacierdem added a commit to anacierdem/libdragon-docker that referenced this pull request Jul 28, 2021
Changed

- Removed make, download, init, buildDragon, prepareDragon, and installDependencies NPM scripts
  - Update the necessary vscode and travis configuration
  - Update the readme to match - this also fixes #31
- Improve fastpath of dfs_read (DragonMinded/libdragon#133)
- Refactor n64tool (DragonMinded/libdragon#153, DragonMinded/libdragon#155)
  - It no longer support byte-swapping and only generates a z64 file.
  - Change test bench Makefile to reflect latest changes

Fixed

- Zero-initialize the token array to avoid -Werror=maybe-uninitialized (DragonMinded/libdragon#134)
- Initialize arguments to main libdragon entrypoint (DragonMinded/libdragon#136)
- SD support fixes and dragonfs fopen fix (DragonMinded/libdragon#137)
- lib/include paths in tests Makefile (DragonMinded/libdragon#138)
- Reenable test_timer_ticks for emulators (DragonMinded/libdragon#140)
- n64tool: return error in case the seek offset required backward seek (DragonMinded/libdragon#144)
- Add missing extern "C" in debug.h (DragonMinded/libdragon#146)
- Ensure C++ global constructors are not garbage collected by ld (DragonMinded/libdragon#148)
- Fix clipped RDP rectangle drawing (DragonMinded/libdragon#147)
- Enable byte swap flag for the make action and update documentation accordingly
- Skip the second parameter to the libdragon command as well
- Enable --byte-swap flag for the make action

Added

- restart_timer and new_timer_stopped functions (DragonMinded/libdragon#131)
- dfs_rom_addr (DragonMinded/libdragon#133)
- Implement EEPROM Filesystem and test ROM (DragonMinded/libdragon#125)
- ed64romconfig binary (DragonMinded/libdragon#153, DragonMinded/libdragon#155)
- Support for RTC status/read/write commands (DragonMinded/libdragon#152)
- Generic libdragon NPM script
anacierdem added a commit to anacierdem/libdragon-docker that referenced this pull request Jul 28, 2021
Changed

- Removed make, download, init, buildDragon, prepareDragon, and installDependencies NPM scripts
  - Update the necessary vscode and travis configuration
  - Update the readme to match - this also fixes #31
- Improve fastpath of dfs_read (DragonMinded/libdragon#133)
- Refactor n64tool (DragonMinded/libdragon#153, DragonMinded/libdragon#155)
  - It no longer support byte-swapping and only generates a z64 file.
  - Change test bench Makefile to reflect latest changes

Fixed

- Zero-initialize the token array to avoid -Werror=maybe-uninitialized (DragonMinded/libdragon#134)
- Initialize arguments to main libdragon entrypoint (DragonMinded/libdragon#136)
- SD support fixes and dragonfs fopen fix (DragonMinded/libdragon#137)
- lib/include paths in tests Makefile (DragonMinded/libdragon#138)
- Reenable test_timer_ticks for emulators (DragonMinded/libdragon#140)
- n64tool: return error in case the seek offset required backward seek (DragonMinded/libdragon#144)
- Add missing extern "C" in debug.h (DragonMinded/libdragon#146)
- Ensure C++ global constructors are not garbage collected by ld (DragonMinded/libdragon#148)
- Fix clipped RDP rectangle drawing (DragonMinded/libdragon#147)
- Enable byte swap flag for the make action and update documentation accordingly
- Skip the second parameter to the libdragon command as well
- Enable --byte-swap flag for the make action

Added

- restart_timer and new_timer_stopped functions (DragonMinded/libdragon#131)
- dfs_rom_addr (DragonMinded/libdragon#133)
- Implement EEPROM Filesystem and test ROM (DragonMinded/libdragon#125)
- ed64romconfig binary (DragonMinded/libdragon#153, DragonMinded/libdragon#155)
- Support for RTC status/read/write commands (DragonMinded/libdragon#152)
- Generic libdragon NPM script
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.

2 participants