Le mardi 6 mars 2012 13:05:40, Christian Jullien a écrit :
> Hello Thomas,
>
> If your heart is in good health, you can also try splint on source code.
>
> The reported warning is true because cv is a CValue defined as
>
> typedef union CValue {
> long double ld;
> double d;
> float f;
> int i;
> unsigned int ui;
> unsigned int ul; /* address (should be unsigned long on 64 bit cpu) */
> long long ll;
> unsigned long long ull;
> struct CString *cstr;
> void *ptr;
> int tab[2];
> } CValue;
>
> But, since CValue is an union, sizeof(CValue) == sizeof(greatest field)
> which is probably "long double"
> To me, this is a real warning, but the code itself is safe.
> To fix it, CValue should be defined with int tab[LDOUBLE_SIZE / 2] or
> something similar.
Indeed, I didn't pay attention it was an union. I looked at it quickly but
considerid it as a struct. My bad, I used this structure before and noticed it
is an union at the time.There is also a warning about a %Lu in tccpp.c but this does not explain the segfault. I should try running a debugger to see if it can help. Best regards, > > Christian. Thomas Preud'homme
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
