cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: vms_show hack explained

From: Yang Tse <yangsita_at_gmail.com>
Date: Thu, 14 Mar 2013 12:51:48 +0100

On Thu, Mar 14, 2013, John E. Malmberg <wb8tyw_at_qsl.net> wrote:

[detailed explanation of vms_special_exit() internals chopped off]
>
> Now if we know at the time that vms_special_exit is called that any exit
> status other than CURLE_OK means that an error message has been written,
> there is no need to have the vms_show hack at all.

Notice that in your explanation above you have missed that curl tool
user may use options 'S' and 's' and these also modify whether and
error message will be written or not upon exit status other than
CURLE_OK.

IOW, there exists the possibility that when vms_special_exit() is
called no message has been shown even upon error. Although this might
not be important it should work, if the user wants to suppress output
that is what she should get.

OTOH, vms_special_exit() will be needed no matter what, in order to
exit with either the DCL exit code or the unix-like one depending on
shell being used.

> We just need to have the VMS specific wrapper to exit() handle everything.
> If that a VMS specific wrapper is changed to be a macro in a VMS header
> file, then this all can be hidden from the common Unix code.

I'm absolutely baffled with some VMS changes that were introduced in
7.29.0, and I much fear that above quoted paragraph means even more in
that direction. I'll explain myself and give you the reason for this
(but please don't take this as something personal, I'm just speaking
from a 'technical' point of view)...

It mostly has to do with 7.29.0 implementation of what you are calling
hiding VMS specifics in header files.

In 7.29.0 lib/setup-vms.h declares and _implements_
vms_translate_path(), vms_getenv() and vms_getpwuid() functions. This
means that every single source file which directly or indirectly
includes this header file will get a private implementation of these
three functions. More specifically it means that _every_ single source
file in libcurl's subdirectory, every single source file in curl tool
subdirectory and also every single source file in tests subdirectory
tree will have a private implementation of those functions when the
source file is finally compiled.

Unless the VMS linker is removing all private unused functions,
libcurl and curl's size will have unnecessarily grown with 7.29.0

At most, setup-vms.h should be defining C preprocessor macros and
including system header files which shall be included in every single
source file before other system headers are individually and
conditionally included in each source file. And not being used to
'feed' function implementations into other source files.

Notice also that, intentionally or not, any system header and any
third party header file included after this one will be influenced by
whatever is inside there. For some third party header adjustments this
is exactly what is needed. But for each line that is included into
setup-vms.h the chance of having to pull more and more system headers
from within setup-vms.h increases and at a given point it will become
broken and unmaintainable.

So please don't fit more function implementations into header files.

For now, we should focus on making sure that 7.30.0 will build out of the box.

BTW, did you miss? http://curl.haxx.se/mail/lib-2013-03/0160.html

-- 
-=[Yang]=-
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2013-03-14