reasons for rewriting regular memory (was: [ANNOUNCE]: clang compiling ports, take 2)

perryh at pluto.rain.com perryh at pluto.rain.com
Mon Sep 5 02:13:29 UTC 2011


Matthias Andree <matthias.andree at gmx.de> wrote:
> > I agree, but I can think of another valid exception. System with
> > Hamming correction on the memory, gets a single bit (correctable)
> > error. Need to rewrite the memory contents to reset all the parity
> > bits!
> That's a matter of the EDAC stuff, not the business of applications.

True, but it may explain why clang does not flag "*x = *x;" when it
does flag "x = x;".  A compiler cannot know the context in which the
compiled code will be used.

BTW I agree that an understanding is needed of _why_ the code in
question was included.  I have seen "x = x;" -- x being a formal
parameter -- used to prevent an "unused argument" warning in a
function which did not in fact need the argument in question, but
had to declare it for uniformity with other functions pointed to
by the same function pointer type.


More information about the freebsd-ports mailing list