[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getcwd() issues on VMS / canonicalize-lgpl.c
From: |
Bruno Haible |
Subject: |
Re: getcwd() issues on VMS / canonicalize-lgpl.c |
Date: |
Wed, 07 Jun 2017 15:33:45 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-79-generic; KDE/5.18.0; x86_64; ; ) |
Hi John,
> > John Malmberg wrote:
> >> 1. The VMS CRTL getcwd() will not pass configure tests and will be
> >> marked for replacement from gnulib.
> >>
> >> 2. The replacement from gnulib causes canonicalize-lgpl.c to fail
> >> because the replacement only has 2 parameters, not three.
> ...
> I have not encountered the relocatable-prog-wrapper on a VMS project
> yet, so I do not know what it is.
In the relocatable-prog-wrapper situation, like in all other uses of
gnulib without the 'getcwd' module, getcwd is not #defined. Therefore,
as I understand, it takes 3 arguments.
> It still does not need the vms specific variant as a production program
> would set the DECCRTL mode to have getcwd() return a Unix format path,
> usually in a "lib$initialize" object.
gnulib does not make use of per-program initializers. Rather, its overrides
must work in programs as well as in libraries, without additional object
files (other than the ones provided by gnulib).
> For a test program, the same could be done, or the script running the
> test can define the logical name DECC$FILENAME_UNIX_REPORT "ENABLE"
> before starting the test.
Programs that use gnulib do not make assumptions about how they are
invoked, or what environments are set when they are run. They must work
out-of-the-box.
To fix the issue you reported, I'm applying this:
2017-06-07 Bruno Haible <address@hidden>
canonicalize-lgpl: Avoid conflict with gnulib 'getcwd' module on VMS.
Reported by John E. Malmberg <address@hidden> in
<https://lists.gnu.org/archive/html/bug-gnulib/2017-06/msg00029.html>.
* lib/canonicalize-lgpl.c (__getcwd): On VMS, when using gnulib's getcwd
override, pass 2 arguments to getcwd, not 3.
diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c
index a32da91..34b3711 100644
--- a/lib/canonicalize-lgpl.c
+++ b/lib/canonicalize-lgpl.c
@@ -59,8 +59,10 @@
*/
# undef getcwd
# endif
-# ifdef VMS
- /* We want the directory in Unix syntax, not in VMS syntax. */
+# if defined VMS && !defined getcwd
+ /* We want the directory in Unix syntax, not in VMS syntax.
+ The gnulib override of 'getcwd' takes 2 arguments; the original VMS
+ 'getcwd' takes 3 arguments. */
# define __getcwd(buf, max) getcwd (buf, max, 0)
# else
# define __getcwd getcwd
> >> 3. The replacement from gnulib also does not fix all the known ills in
> >> VMS getcwd().
This is something that sounds worthy to look at. As I understand it, the
configure test already marks the getcwd function as to be overridden (because
the incompatible prototype); therefore the fixes should be limited to
modifications
of lib/getcwd.d and lib/getcwd-lgpl.c.
Bruno