| From | Sent On | Attachments |
|---|---|---|
| Roman Divacky | Jul 25, 2011 8:58 am | |
| Diane Bruce | Jul 25, 2011 10:06 am | |
| George Liaskos | Jul 25, 2011 12:06 pm | |
| Matthias Andree | Jul 25, 2011 2:53 pm | |
| Raphael Kubo da Costa | Jul 25, 2011 4:30 pm | |
| Chuck Swiger | Jul 25, 2011 4:58 pm | |
| Florent Thoumie | Jul 26, 2011 1:24 am | |
| Gerald Pfeifer | Sep 3, 2011 8:08 pm | |
| Ruslan Mahmatkhanov | Sep 3, 2011 11:41 pm | |
| Ivan Klymenko | Sep 4, 2011 12:12 am | |
| Matthias Andree | Sep 4, 2011 12:26 am | |
| Michel Talon | Sep 4, 2011 12:29 am | |
| Matthias Andree | Sep 4, 2011 12:32 am | |
| Matthias Andree | Sep 4, 2011 12:34 am | |
| Ivan Klymenko | Sep 4, 2011 1:45 am | |
| Mark Linimon | Sep 4, 2011 1:48 am | |
| Matthias Andree | Sep 4, 2011 3:22 am | |
| Matthias Andree | Sep 4, 2011 3:24 am | |
| Bob Eager | Sep 4, 2011 5:06 am | |
| Matthias Andree | Sep 4, 2011 6:31 am | |
| per...@pluto.rain.com | Sep 4, 2011 7:13 pm | |
| Ruslan Mahmatkhanov | Sep 5, 2011 4:42 am | |
| Ruslan Mahmatkhanov | Sep 5, 2011 4:45 am | |
| Matthias Andree | Sep 5, 2011 9:43 am | |
| Oliver Fromme | Sep 5, 2011 1:19 pm |
| Subject: | Re: reasons for rewriting regular memory | |
|---|---|---|
| From: | Matthias Andree (matt...@gmx.de) | |
| Date: | Sep 5, 2011 9:43:22 am | |
| List: | org.freebsd.freebsd-ports | |
Am 05.09.2011 11:09, schrieb per...@pluto.rain.com:
Matthias Andree <matt...@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.
And a compiler is free to optimize either away unless the storage class is "volatile", so the original point stands:
BTW I agree that an understanding is needed of _why_ the code in question was included.
Which waits on the original author.
On the other issue:
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.
The portable and concise solution is to cast unused arguments to void, as in this example:
int f(int used, int unused) { (void)unused; // avoids warnings
// ... // now do something with used // ...
return 42; }
_______________________________________________ free...@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to "free...@freebsd.org"





