This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: option X_TLOSS error.


>>>>> "Giovanni" == Giovanni Perbellini <perbelli@sci.univr.it> writes:

    Giovanni> Dear Jonathan,
    Giovanni> I tried the following:
    Giovanni> +downloaded a CVS image from scratch (at today)

    Giovanni> +ran ecosconfig 2.11 on linux redhat 8.0. Once entered the repository
    Giovanni> I get:
    Giovanni> /opt/CROSSCOMPDIR/ecos/src/ecos-cvs-040203/ecos/packages/language/c/libm/current/cdl/libm.cdl,
    Giovanni> option X_TLOSS, property default_value: error    Invalid floating point constant `1.41484755040568800000E+16'.
    Giovanni>      <end of data>{.41484755040568800000e+16}

    <snip>

That particular error message is coming from inside libcdl. It
currently has the string "1.41484755040568800000e+16" and is trying to
check that this is a valid double precision number. To do so it calls
the C library routine strtod(), and presumably that function is
behaving slightly differently with your specific setup. This is a bit
strange, since functions like strtod() don't change all that often.

Could you try to compile the following program on your Linux box?

------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>

#define VALUE "1.41484755040568800000e+16"

int
main(int argc, char** argv)
{
    char*   end_ptr;
    double  result;

    errno  = 0;
    result = strtod(VALUE, &end_ptr);
    if (errno != 0) {
        printf("Conversion failed, errno %d\n", errno);
    }
    printf("Start_ptr %p, end_ptr %p, *end_ptr %x\n", VALUE, end_ptr, *end_ptr);
    return EXIT_SUCCESS;
}
------------------------------------------------------------------------

On my machine the conversion succeeds and I get the following output:

    Start_ptr 0x8048580, end_ptr 0x804859a, *end_ptr 0

which is what I would expect, with end_ptr pointing at the string's
terminating \0

Bart

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]