# On #\<, #\> and -w (void context warnings)

**URL:** <https://www.ruby-forum.com/t/on-and-w-void-context-warnings/70571>\
**Category:** Ruby\
**Created:** [September 30, 2006, 8:05am UTC](https://www.ruby-forum.com/t/on-and-w-void-context-warnings/70571 "2006-09-30T08:05:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rue](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b77776/32.png) [@rue](https://www.ruby-forum.com/u/rue)\
**Post date:** [September 30, 2006, 8:05am UTC](https://www.ruby-forum.com/t/on-and-w-void-context-warnings/70571/1 "2006-09-30T08:05:53Z")

</div>

Hello!

Time for the weekly syntax analysis thingy. ruby -w causes  
this code to issue a warning:

# warning: useless use of \< in void context

‘/tmp/foo’ \< “Some text here”

Same goes for #\>. The problem, somewhat obviously, goes away  
when the same expression is used in a conditional position.

I was thinking about it and there is really no way to avoid  
this assuming that the warning is considered to be useful  
for those instances where someone accidentally uses this  
type of an expression outside a conditional.

---

<div class="post-metadata">

**Author:** ![rue](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b77776/32.png) [@rue](https://www.ruby-forum.com/u/rue)\
**Post date:** [September 30, 2006, 10:51am UTC](https://www.ruby-forum.com/t/on-and-w-void-context-warnings/70571/2 "2006-09-30T10:51:59Z")

</div>

Eero S. wrote:

> I was thinking about it and there is really no way to avoid  
> this assuming that the warning is considered to be useful  
> for those instances where someone accidentally uses this  
> type of an expression outside a conditional.

This is a quite accurate summary.

Kind regards

```
robert
```
