|
Boost-Build : |
From: bill_kempf (williamkempf_at_[hidden])
Date: 2002-03-07 15:36:55
--- In jamboost_at_y..., "David Abrahams" <david.abrahams_at_r...> wrote:
>
> ----- Original Message -----
> From: "bill_kempf" <williamkempf_at_h...>
> To: <jamboost_at_y...>
> Sent: Thursday, March 07, 2002 12:44 PM
> Subject: [jamboost] Re: Short-circuit evaluation
>
>
> > --- In jamboost_at_y..., Vladimir Prus <ghost_at_c...> wrote:
> > > Rene Rivera wrote:
> > > > How about the PWD builtin?
> > >
> > > Made a commit to that effect. If anybody could check it with
MSVC,
> > this would
> > > be great.
> >
> > The pwd.c file fails to compile with MSVC, complaining that
<dir.h>
> > couldn't be found. A search for this header revealed it in my
mingw
> > set up and inspecting this header showed that (for mingw at
least)
> > it's an obsolete header that does nothing but include <io.h>. So
I
> > made a local change to pwd.c to include <io.h> instead, and
> > everything compiles, though I receive the following warning:
> >
> > pwd.c(18) : warning C4047: '==' : 'int ' differs in levels of
> > indirection from '
> > void *'
Actually, you don't even need to include <io.h>, so I'm not sure why
the include for <dir.h> was even there.
> In C++ that would be an error; you're passing an int as a void*.
The "int" in question is 0, or NULL, which can be converted to a
pointer in C++. In any event the file has a .c extension so is being
compiled as C, not C++. I'm not sure I understand why the warning is
occuring. Comparing the return from getcwd() to NULL should not
produce a warning (or an error) and is the documented way to test for
failures.
Bill Kempf
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk