This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 0/4] bitpos expansion summary reloaded
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 29 Sep 2012 19:39:38 +0200
- Subject: Re: [PATCH 0/4] bitpos expansion summary reloaded
- References: <20120927190053.1e7de264@spoyarek>
Hi Siddhesh,
I have reported without effect:
But for example ada-valprint.c:700 is not reported in this file at all, why?
ada-valprint.c:700 is the last line of this extracted code:
LONGEST offset;
int offset_aligned;
const gdb_byte *valaddr;
const gdb_byte *ada_aligned_value_addr (struct type *type, const gdb_byte *valaddr);
offset_aligned = offset + ada_aligned_value_addr (type, valaddr) - valaddr;
Reduced testcase:
int main (void) {
const char *a = "", *b = "";
int reported, missed;
long longvar = 0;
reported = longvar;
missed = longvar + a - b;
return reported + missed; }
splint -hints -linelen 999:
../../../t/t.c: (in function main)
../../../t/t.c:5:3: Assignment of long int to int: reported = longvar
splint -hints -linelen 999 -checks:
../../../t/t.c: (in function main)
../../../t/t.c:5:3: Assignment of long int to int: reported = longvar
../../../t/t.c:6:22: Pointer arithmetic involving possibly null pointer a: longvar + a
splint -hints -linelen 999 -strict:
../../../t/t.c: (in function main)
../../../t/t.c:5:3: Assignment of long int to int: reported = longvar
../../../t/t.c:6:12: Pointer arithmetic (long int, char *): longvar + a
../../../t/t.c:6:22: Pointer arithmetic involving possibly null pointer a: longvar + a
../../../t/t.c:6:12: Operands of - are non-numeric (char *): longvar + a - b
These warnings are in fact OK but the problematic assignment
of ptrdiff_t to int variable 'missed' is not reported at all.
We need to either fix splint or (more likely) use a different tool, there are
too many cases missed this way.
Regards,
Jan