On Mon, May 21, 2007 at 10:03:08PM +0200, Ulf Lamping wrote:
> > put fwrite and fread into DISSECTOR_ASSERT in order to use the result
> >
> Is it a good idea to put "productive" code into an DISSECTOR_ASSERT?
>
> At least the ANSI C assert() won't call any comparison code at all in a
> release version.
Well, as we call an IO function, the overhead of the comparison should be
negligible.
> Without looking deeply into the code: This seems to be a problem which
> could possibly happen - and therefore should better be handled by
> returning an error code IMHO.
As I don't know the code, I added something that draws attention without
aborting the whole program. The only thing I didn't manage to figure out
was whether it's legal to call this function in that place :-/
> However, at least it's a bit better than before ;-)
Well, it gets rid of a warning on Suse systems which prevented
compilation, but whether it is an improvement: I don't know....
But that kind of stuff happens if you only have limited time (and
knowledge of the code involved) but *must* fix a warning due to
-Werror.
ciao
Joerg
--
Joerg Mayer <jmayer@xxxxxxxxx>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.