I try to give you an answer: You may use +relax-quals to filter conversions from a smaller type to a larger one "Report qualifier mismatches only if dangerous (information may be lost since a larger type is assigned to (or passed as) a smaller one or a comparison uses signed and unsigned values.)" You may also use +ignore-signs if you need to filter conversions between unsigned and signed "Ignore signs in type comparisons (unsigned matches signed)." I also add a question: I'd like to filter conversions from a number to a variable, still detecting conversions from a variable to a variable. Anyway, I was not able to do it. Could you help me ? For example: unsigned char f = 0x01; // Spling gives me: Variable f initialized to type int, expects unsigned char: 0x01 I know it is not correct (it lacks an explicit cast), anyway for legacy code it is less serious than: int j32 = i16;
Thanks Marco Giromini OTE S.p.A. - A Finmeccanica Company voice: +39-050-3132.473 e-mail: [EMAIL PROTECTED] John Carter <[EMAIL PROTECTED]>@cs.virginia.edu on 09/11/2003 05:25:57 AM Please respond to [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: [splint-discuss] Detecting lossy int conversions. How do you convince splint to detect only lossy implicit int conversions? For example.... int i32 = 70000; short i16 = i32; // Danger! Lossy conversion splint please flag me! int j32 = i16; // Different type, but that's OK. C copes just fine with // the widening conversion. Thanks, John Carter Phone : (64)(3) 358 6639 Tait Electronics Fax : (64)(3) 359 4632 PO Box 1645 Christchurch Email : [EMAIL PROTECTED] New Zealand A Million Monkeys can inflict worse things than just Shakespeare on your system. _______________________________________________ splint-discuss mailing list [EMAIL PROTECTED] http://www.splint.org/mailman/listinfo/splint-discuss _______________________________________________ splint-discuss mailing list [EMAIL PROTECTED] http://www.splint.org/mailman/listinfo/splint-discuss