[Aldor-l] Code audit

Pippijn van Steenhoven pip88nl at gmail.com
Sat Jun 28 16:11:14 EDT 2008


Hi, here are some more areas of doubt:

genfoam.c:7335 (genGetConstNums)
  genHasConstNum is a function which (as its name tells us) checks
  something and returns true or false. The return value of the function
  is not being used for anything, which makes me wonder whether this code
  is correct. Can someone please tell me more about this?

gf_add.c:2152 (gen0RtSefoHashId)
  Same thing as above, gen0Syme generates something but the value is not
  used.

gf_seq.c:1129 (dgOrderError)
  bufLiberate is called with the comment /* Free the buffer and other
  storage */. While this is true, the memory for the internal string is
  not freed.

gf_seq:1069 (dgCycleError)
  Same as dgOrderError.

inlutil.c:309 (inuProgFini)
  flogToProg reconstructs a foam program from a flow graph. The Foam
  object returned is not used. I believe it also forces an update to
  flog->prog, so it might be sane.

of_jflow.c:159 (jflowProg)
  Same as above.

optfoam.c:426 (optimizeFoam)
  foamAuditAll is called. This does some checking on e.g. casts, types,
  etc. It returns a boolean result, which is not used. Does it make sense
  to call the audit in that case?

util.c:389 (DFloatSprint)
  Returns the character buffer it received. Would it not be better to
  return the return value from the sprintf called inside the function?
  Returning the string gives us no information at all.

stab.c:1351 (stabDefLibrary)
  tfFrSyme is called, the return value is not used.

stab.c:1372 (stabDefArchive)
  Same as above.


Some of these are more serious than others. Some may not be harmful at
all, but if someone knows the code, I would like to know what to think of
them.

-- 
Pippijn van Steenhoven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.aldor.org/pipermail/aldor-l_aldor.org/attachments/20080628/78ed64a4/attachment-0002.bin>


More information about the Aldor-l mailing list