[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] #1 Update on port to OS400/EBCDIC

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2006-02-13 20:38:01 CET

Paul Burba wrote:
>
> You said to commit this last Friday, but given all the changes since then
> I thought it best to post the log and patch again, to make sure this is
> what everyone had in mind.

Thanks.

> -main (int argc, const char * const *argv)
> +main(int argc, char *argv[])
[...]
> - apr_getopt_init (&os, pool, argc, argv);
> + svn_cmdline_getopt_init (&os, pool, argc, argv);

subversion/svn/main.c:834: warning: passing argument 4 of
'svn_cmdline_getopt_init' from incompatible pointer type

I think it's the C language and/or compiler that's being a bit unreasonable
about pointer compatibility here, but nevertheless I try to avoid this situation.

Could we compromise and make it:

   main(int argc, const char *argv[])

That won't be quite as the C standard says, but it will be a step closer than
what we have now. An alternative is to remove "const" from the signature of
svn_cmdline_getopt_init(), but that would require a cast inside the function
when calling apr_getopt_init.

Secondly, I'm a little uneasy about introducing a public API that's documented
in terms of what it does on one particular platform, and that we may well want
to change soon to do stuff on other platforms and/or to handle the "-m"
argument differently. Can we make it private just by including a double
underscore in it and adding a note to that effect?

   /* [...] This is a private API for Subversion's own use. */
   svn_cmdline__getopt_init ...

(We've previously been unable to decide in exactly what ways we can use private
symbols, but I hope this usage won't be objectionable.)

Later you wrote:
> - apr_getopt_init (&os, pool, argc, argv);
> + err = svn_cmdline_getopt_init (&os, pool, argc, argv);
> + if (err)
> + return svn_cmdline_handle_exit_error (err, pool, "svn: ");

+1 on that.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Feb 13 20:38:46 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.