On Apr 10, 4:19 pm, Jason <ja...@njkfrudils.plus.com> wrote:
> On Saturday 09 April 2011 18:48:19 Cactus wrote:
>
>
>
> > On Apr 9, 6:09 pm, Cactus <rieman...@gmail.com> wrote:
> > > On Apr 9, 5:52 pm, Jason <ja...@njkfrudils.plus.com> wrote:
> > > > On Saturday 09 April 2011 17:15:45 Cactus wrote:
> > > > > The mpz.get_ux/sx and mpz..set_ux/sx tests now fail on MSVC (they
> > > > > used to work) because the stdint.h include in the test files has
> > > > > been guarded with HAVE_STDINT_H.
>
> > > > > But since these test files don't include config.h, HAVE_STDINT_H is
> > > > > not defined so stdint.h is not included and the function definitions
> > > > > in mpir.h are hence bypassed.
>
> > > > > The use of the HAVE_STDINT_H guard in these test files is wrong since
> > > > > these tests are NOT internal MPIR tests but tests of the external API
> > > > > where end users will expect the inclusion of stdint.h alone to be
> > > > > sufficient.
>
> > > > > Jason, I assume you added these guards.  If so, can you let me know
> > > > > why they are needed as I think it is a mistake if they are.
>
> > > > >     Brian
>
> > > > Yeah , for the guard to be of any use we would also need to put
> > > > #include "config.h" in these specific tests which I forgot , I do
> > > > notice that a few other tests have it in
> > > > grep -e config.h $(find -name \*.c)
> > > > ./spinner.c:#include "config.h"
> > > > ./mpn/t-get_d.c:#include "config.h"
> > > > ./mpn/t-invert.c:#include "config.h"
> > > > ./devel/try.c:#include "config.h"
> > > > ./misc/t-scanf.c:#include "config.h"
> > > > ./misc/t-locale.c:#include "config.h"
> > > > ./misc/t-printf.c:#include "config.h"
> > > > ./mpf/t-inp_str.c:#include "config.h"
> > > > ./misc.c:#include "config.h"
> > > > ./cxx/clocale.c:#include "config.h"
> > > > ./mpz/t-io_raw.c:#include "config.h"
> > > > ./mpz/io.c:#include "config.h"
> > > > ./mpz/t-inp_str.c:#include "config.h"
> > > > ./mpq/t-aors.c:#include "config.h"
> > > > ./mpq/t-inp_str.c:#include "config.h"
>
> > > > it's either put it in or write some configure code(and batch file
> > > > stuff) to exclude all these new tests. Linux has had stdint for
> > > > probably at least 10 years , not sure about darwin,solaris, etc , the
> > > > only one I know of definitely is VS <=2008
> > > > Including this guard and including config.h , should not affect the
> > > > test , the user will just include stdint.h if needed and can ignore
> > > > config.h , like we do the the other tests that include it
>
> > > > Jason
>
> > > I now see that the same problem also occurs in the six files within
> > > MPIR that implement these new functions.
>
> > > We would have to include config.h in all of these files even though we
> > > already include it in mpir.h anyway.
>
> > > This would be a horrible kludge since the contorted relationships
> > > between the various headers is already a nightmare (I support your
> > > efforts to clean some of this up!).
>
> > > If VS <= 2008 is the only issue, we can exclude the whole file by
> > > using a specific _MSC_VER version number.
>
> > >      Brian
>
> > If I use the guard:
>
> > #if defined( _MSC_VER ) && _MSC_VER >= 1600 ||
> > defined( HAVE_STDINT_H )
>
> we would still need to include config.h to get the HAVE_STDINT_H , which makes
> the MSC_VER bit redundant
>
> > in all the new mpz_sx/ux files (in MPIR and in the tests) all is then
> > well for VS 2010.  But I can't test VS 2008 nowadays.
>
> > Within MPIR the above guard results in an empty source code file when
> > it evaluates to FALSE.  Is this an issue?
>
> No
>
> > In the sx/ux tests there will be an output of 99 when this guard is
> > FALSE.
>
> we want an output the same as if the test passed
>
>
>
> > I haven't put any of this in SVN yet though, in case it will cause
> > obvious problems.
>
> >    Brian

Hi Jason,

What is wrong with positive return values for 'non failures' and
negative values for failures?

This way the Python test code can differentiate between failure, not
tested, and success, which is useful as it will show if things are
being wrongly excluded from a build.

Returning to the stdint.h issue, I think that the simplest solution is
to add:

#ifdef HAVE_STDINT_H
#  include <stdint.h>
#endif

in gmp-impl.h (after config.h has been included) since all the files
involved include gmp-impl.h

     Brian

-- 
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To post to this group, send email to mpir-devel@googlegroups.com.
To unsubscribe from this group, send email to 
mpir-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/mpir-devel?hl=en.

Reply via email to