<div dir="auto">aye, but only if you're stuck with a compiler from the 1990s... even gcc has warned about that for years :-P</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 31, 2023, 20:33 Rob Landley <<a href="mailto:rob@landley.net">rob@landley.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 1/31/23 10:33, enh via Toybox wrote:<br>
> The open() call was the only remaining use of the named permission<br>
> constants, and the equivalent permissions are given in octal just<br>
> a couple of lines later. This seems like a solid entry for the next<br>
> toybox release's pedantry award.<br>
<br>
I applied this, but FYI the constant == function() stuff is so a typoed<br>
assignment instead of comparison barfs with not-an-lvalue. It's a style thing<br>
where an assignment not only _can't_ silently drop in for a comparison, and is<br>
also more easily visually distinguished. (If constant is on the left it can only<br>
be a comparison.)<br>
<br>
Serves a purpose. In this case you can't assign to a function return value, but<br>
*function() happens too, and the warning unless it has parentheses isn't a<br>
strong defense either because a&b || c also needs parentheses so they tend to<br>
happen...<br>
<br>
Otherwise they're theoretically equivalent, so changing it to be the other way<br>
because it "looks wrong" otherwise... seems weird to me? It looks like it<br>
couldn't be an assignment. That's the point...<br>
<br>
Rob<br>
</blockquote></div>