RISC OS Open
Safeguarding the past, present and future of RISC OS for everyone
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

Previous|Next

  • Tickets
  • » Ticket #306

Ticket #306 (Fixed)Thu Aug 30 13:10:15 UTC 2012

CMHG's comments on *CONFIGURE handlers is wrong

Reported by: Sprow (202) Severity: Minor
Part: RISC OS: C/C++ toolchain Release:
Milestone: Status Fixed

Details by Sprow (202):

The autogenerated header file from CMHG for command handlers is wrong, it states that if it’s a configure command then argc contains the number of arguments. It does not, confirmed by being baffled twice by this and having to look in the PRM then look in the kernel. Grr.

Changelog:

Modified by Ben Avison (25) Fri, August 31 2012 - 10:45:25 GMT

I spotted this myself when writing SDFS. It turns out argc is a pain to use even for normal star commands, because it’s counted according to OS_CLI’s rules. See the hoops I had to jump through to create a list of arguments that corresponded to argc:

http://www.riscosopen.org/viewer/view/cddl/Risc…

I’m actually quite tempted to modify cmhg to give authors an option to receive the arguments to the command handler in the same manner as main()‘s argc/argv so that all the above doesn’t need duplicating in every module.

Modified by Sprow (202) Mon, September 03 2012 - 22:16:32 GMT

Other modules get the same entry conditions because that’s whatever junk the kernel has left in that register (specifically for *CONFIGURE) so least effort is to ammend the comment block CMHG outputs.

Extra gold star for a new keyword “commands-pass-argc-argv:” hint in the CMHG file that prefixes some autogenerated parsing code too. In my case(s) I didn’t need this as the configure keyword had only 1 parameter so I just used strcmp().

Modified by Jeffrey Lee (213) Sun, November 02 2014 - 14:03:23 GMT

  • Status changed from Open to Fixed

*Configure handler comments are now corrected as of cmhg 5.43 (DDE 25)

  • Comment on, or change status of, this ticket

Previous|Next

Search tickets

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Options

  • Tickets
  • New ticket
  • Milestones
  • Subversion: Changesets
  • Subversion: Browse
  • CVS: Revisions
  • CVS: Browse
  • Search

RSS feeds Rss

  • Tickets
  • Everything!
  • More feeds...
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Collaboa theme is distantly based on the Collaboa default layout

Valid XHTML 1.0  |  Valid CSS

Powered by Collaboa
This site runs on Rails

Hosted by Arachsys