SSVAL()

tridge at samba.org tridge at samba.org
Tue Apr 20 16:10:42 MDT 2010


 > Given a recent bug I had to fix because I was not aware
 > SSVAL is a macro (I used val++ in the argument), I have to
 > agree with Jeremy that macros should be as ugly to read as
 > possible.

I just noticed that SSVAL only uses its arguments twice on some
platforms (it depends if CAREFUL_ALIGNMENT is set). That is a
potential trap as testing will only catch this on some systems.

I wonder what the performance penalty would be if we instead declared
a local variable inside the macro (using do {} while (0)} and thus
didn't reuse the argument?

Cheers, Tridge


More information about the samba-technical mailing list