Hello,

On Sep 24 22:22 Olaf Meeuwissen wrote (excerpt):
One, in sanei_ir.c, deserves some attention as it produces potentially
undefined behaviour.  It's really the same issue as reported in 311857,
which I recently reopened.

 ../../../sanei/sanei_ir.c:481:11: warning: multiple unsequenced modifications 
to 'outi' [-Wunsequenced]
    *outi++ = *outi++ >> is;

The two increments may occur in any given order, IIUC[3].

[3] http://c-faq.com/expr/seqpoints.html

In general I would even demand that nowadays such kind
of fancy coding stlye should no longer be done at all.

With nowadays compiler optimizations it does not matter
if one writes

  y = x++ * 2;

or

  y = x * 2;
  x++;

The former is selfish and oversophisticated coding.
In this case it is a mix-up of two separated things.

The latter is altruistic and explicit coding that
makes it obvious for others what actually is meant.

If the two separated things are meant as one statement
one might (ab)use the "one statement per line" rule

  y = x * 2; x++;

which is still much more obvious than "y = x++ * 2;".

Of course everybody understands what "y = x++ * 2;" means.
This is only used here as a simple example.


Kind Regards
Johannes Meixner
--
SUSE LINUX GmbH - GF: Felix Imendoerffer, Jane Smithard,
Graham Norton - HRB 21284 (AG Nuernberg)


--
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
            to sane-devel-requ...@lists.alioth.debian.org

Reply via email to