This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB 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]

[Bug sim/18273] sim: various cppcheck warnings


https://sourceware.org/bugzilla/show_bug.cgi?id=18273

--- Comment #5 from dcb <dcb314 at hotmail dot com> ---
>Thanks very much for reporting this typos/bugs.

You are welcome. Nice to know I'm not wasting my time ;->

>Please feel free to post any more sim related typos that you uncover to this PR.

Righto.

1.

[src/sim/moxie/interp.c:1250]: (error) Resource leak: f

Missing fclose on error path. Doesn't look very important to me.

2.

[src/sim/common/sim-fpu.c:1110]: (style) Unsigned variable 'fraction' can't be
negative so it is unnecessary to test it.

Source code is 

  if ((signed64) f->fraction >= 0)

Some () might help clarify meaning here. Static analysis tool cppcheck
might be getting confused here.

3.

[src/sim/common/sim-fpu.c:1264]: (style) Unsigned variable 'fraction' can't be
negative so it is unnecessary to test it.

Duplicate.

4.

[src/sim/erc32/sis.c:205]: (style) Expression is always false because 'else if'
condition matches previous condition at line 171.

5.

[src/sim/m68hc11/gencode.c:1469]: (style) Expression is always false because
'else if' condition matches previous condition at line 1460.

6.

[src/sim/ppc/hw_htab.c:552] -> [src/sim/ppc/hw_htab.c:552]: (style) Same
expression on both sides of '>='.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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