From: Christopher Sean Morrison <brlcad@ma...> - 2010-04-26 15:51:43
On Monday, April 26, 2010, at 11:39AM, "Tom Browder" <tom.browder@...> wrote:
>On Mon, Apr 26, 2010 at 10:35, <brlcad@...> wrote:
>> Revision: 38782
>> Author: brlcad
>> Date: 2010-04-26 15:35:18 +0000 (Mon, 26 Apr 2010)
>> Log Message:
>> bah, more quellage. can't declare and set on same line or gcc figures out we're not doing anything with that
>Why, then do you need ret at all?
Since we've enabled strict-mode compilation with verbose warnings, GCC has pragmas set on read() and write() to emit a warning if return values are not being inspected. The success or failure of write() in that particular piece of code is irrelevant, so there's nothing to really do with the return code but the value must at least be captured to quell the warning.
Alternatively for this particular snippet, we could check for a failed write() and log a warning message of some sort, but given it's not one to be concerned with, I went with the minimal-effort solution.
Get latest updates about Open Source Projects, Conferences and News.