[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[csmith-dev] csmith error



Hi all,

I could not run compiler_test.pl on my c compiler. So I ran csmith to
create a test.c. Then I compiled the test.c  with my c compiler, I got
the following error message: ( There were more error before I managed to
fix some.)

c:\cygwin\home\User\csmith\runtime\safe_math.h(21) : warning: W1315:
converting 'long' to 'char' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(24) : warning: W1315:
converting 'long' to 'char' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(35) : warning: W1315:
converting 'long' to 'char' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(38) : warning: W1315:
converting 'long' to 'char' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(49) : warning: W1315:
converting 'long' to 'char' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(52) : warning: W1315:
converting 'long' to 'char' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(63) : warning: W1315:
converting 'long' to 'char' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(66) : warning: W1315:
converting 'long' to 'char' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(76) : warning: W1315:
converting 'long' to 'char' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(78) : warning: W1315:
converting 'long' to 'char' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(88) : warning: W1315:
converting 'long' to 'char' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(90) : warning: W1315:
converting 'long' to 'char' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(542) : warning: W1315:
converting 'long' to 'uchar' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(549) : warning: W1315:
converting 'ulong' to 'uchar' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(556) : warning: W1315:
converting 'ulong' to 'uchar' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(563) : warning: W1315:
converting 'ulong' to 'uchar' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(573) : warning: W1315:
converting 'ulong' to 'uchar' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(575) : warning: W1315:
converting 'ulong' to 'uchar' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(585) : warning: W1315:
converting 'ulong' to 'uchar' loss of precision
c:\cygwin\home\User\csmith\runtime\safe_math.h(587) : warning: W1315:
converting 'ulong' to 'uchar' loss of precision
C:\cygwin\home\User\csmith\tmp-test\a2p_test02.c(51) : error: C1295:
'xor' only valid on binary types
C:\cygwin\home\User\csmith\tmp-test\a2p_test02.c(52) : warning: W1315:
converting 'long' to 'char' loss of precision

I have defined NO_LONGLONG. I don't understand the C1295 error. I also
attached the test file.

Your help is appreciated.

Thanks,

Bill

/*
 * This is a RANDOMLY GENERATED PROGRAM.
 *
 * Generator: csmith 2.0.0
 * svn version: exported
 * Options:   (none)
 * Seed:      2092644764
 */

#include "csmith.h"


long __undefined;

/* --- Struct/Union Declarations --- */
/* --- GLOBAL VARIABLES --- */
int16_t g_2[7] = {0xE387L, 0xEC2DL, 0x971CL, 0xEC2DL, 0xE387L, 0xE91AL, 0xE387L};
volatile int32_t g_3 = 0x84B81147L;/* VOLATILE GLOBAL g_3 */
int32_t g_5[2] = {(-10L), (-10L)};
int32_t * volatile g_29 = &g_5[1];/* VOLATILE GLOBAL g_29 */
int32_t g_35 = 4L;


/* --- FORWARD DECLARATIONS --- */
int64_t  func_1(void);
int64_t  func_13(int32_t * p_14);
int32_t * func_15(int32_t * p_16, int32_t * p_17, int8_t  p_18);
int32_t * func_22(int16_t  p_23);


/* --- FUNCTIONS --- */
/* ------------------------------------------ */
/* 
 * reads : g_3 g_2 g_5 g_29 g_35
 * writes: g_3 g_5 g_35
 */
int64_t  func_1(void)
{ /* block id: 0 */
    uint16_t l_12[9][6] = {{65529U, 65529U, 1U, 65529U, 65529U, 1U}, {65529U, 65529U, 1U, 65529U, 65529U, 1U}, {65529U, 65529U, 1U, 65529U, 65529U, 1U}, {65529U, 65529U, 1U, 65529U, 65529U, 1U}, {65529U, 65529U, 1U, 65529U, 65529U, 1U}, {65529U, 65529U, 1U, 65529U, 65529U, 1U}, {65529U, 65529U, 1U, 65529U, 65529U, 1U}, {65529U, 65529U, 1U, 65529U, 65529U, 1U}, {65529U, 65529U, 1U, 65529U, 65529U, 1U}};
    uint8_t l_28[3];
    int32_t *l_34 = &g_35;
    int i, j;
    for (i = 0; i < 3; i++)
        l_28[i] = 0x57L;
    for (g_3 = 0; g_3 < 7; g_3 += 2)
    { /* block id: 1 */
        int32_t *l_4 = &g_5[1];
        (*l_4) &= g_2[(uint32_t)(g_3) % 7];
        return (*l_4);
    }
    (*g_29) = ((g_2[(uint32_t)(g_3) % 7] == (safe_sub_func_int32_t_s_s(((safe_mod_func_int32_t_s_s(g_5[1], (safe_rshift_func_uint16_t_u_u(l_12[4][0], 14)))) & func_13(0)), (((g_5[1] != g_5[1]) || l_28[2]) ^ l_12[4][0])))) && 0x2D50C857617C0EC0LL);
    (*l_34) &= ((safe_rshift_func_int8_t_s_u(g_2[4], (((safe_rshift_func_int16_t_s_u((l_28[2] | g_5[1]), 7)) && (0x0C197911L >= (*g_29))) < l_28[2]))) || g_5[1]);
    return g_35;
}


/* ------------------------------------------ */
/* 
 * reads : g_2
 * writes:
 */
int64_t  func_13(int32_t * p_14)
{ /* block id: 5 */
    uint8_t l_25 = 1U;
    int32_t *l_26 = &g_5[1];
    int32_t **l_27 = &l_26;
    (*l_27) = p_14;
    return g_2[0];
}


/* ------------------------------------------ */
/* 
 * reads : g_2
 * writes:
 */
int32_t * func_15(int32_t * p_16, int32_t * p_17, int8_t  p_18)
{ /* block id: 6 */
    int32_t l_21 = 0x350D8AF8L;
    (*p_16) ^= (p_18 | ((safe_sub_func_uint16_t_u_u(g_2[6], 5L)) > l_21));
    return p_17;
}


/* ------------------------------------------ */
/* 
 * reads :
 * writes:
 */
int32_t * func_22(int16_t  p_23)
{ /* block id: 9 */
    int32_t *l_24 = &g_5[0];
    return l_24;
}




/* ---------------------------------------- */
int main (int argc, char* argv[])
{
    int i;
    int print_hash_value = 0;
    if (argc == 2 && strcmp(argv[1], "1") == 0) print_hash_value = 1;
    platform_main_begin();
    crc32_gentab();
    func_1();
    for (i = 0; i < 7; i++)
    {
        transparent_crc(g_2[i], "g_2[i]", print_hash_value);
        if (print_hash_value) printf("index = [%d]\n", i);

    }
    transparent_crc(g_3, "g_3", print_hash_value);
    for (i = 0; i < 2; i++)
    {
        transparent_crc(g_5[i], "g_5[i]", print_hash_value);
        if (print_hash_value) printf("index = [%d]\n", i);

    }
    transparent_crc(g_35, "g_35", print_hash_value);
    platform_main_end(crc32_context ^ 0xFFFFFFFFUL);
    return 0;
}

/************************ statistics *************************
XXX max struct depth: 0
breakdown:
   depth: 0, occurrence: 13

XXX max expression depth: 0
breakdown:
   depth: 0, occurrence: 10

XXX total number of pointers: 8

XXX times a variable address is taken: 2
XXX times a pointer is dereferenced on RHS: 2
breakdown:
   depth: 1, occurrence: 2
XXX times a pointer is dereferenced on LHS: 5
breakdown:
   depth: 1, occurrence: 5
XXX times a pointer is compared with null: 0
XXX times a pointer is compared with address of another variable: 0
XXX times a pointer is compared with another pointer: 0
XXX times a pointer is qualified to be dereferenced: 4

XXX max dereference level: 1
breakdown:
   level: 0, occurrence: 0
   level: 1, occurrence: 14
XXX number of pointers point to pointers: 1
XXX number of pointers point to scalars: 7
XXX number of pointers point to structs: 0
XXX percent of pointers has null in alias set: 25
XXX average alias set size: 1

XXX times a non-volatile is read: 27
XXX times a non-volatile is write: 9
XXX times a volatile is read: 1
XXX    times read thru a pointer: 0
XXX times a volatile is write: 1
XXX    times written thru a pointer: 0
XXX times a volatile is available for access: 4
XXX percentage of non-volatile access: 94.7

XXX forward jumps: 0
XXX backward jumps: 0

XXX stmts: 16

XXX percentage a fresh-made variable is used: 22.2
XXX percentage an existing variable is used: 77.8
********************* end of statistics **********************/