Project

General

Profile

Bug #1692

warning: useless use of a literal in void context

Added by znz (Kazuhiro NISHIYAMA) over 10 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 1.9.2dev (2009-06-24 trunk 23837) [i686-linux]
Backport:
[ruby-dev:38717]

Description

=begin
1.8 では
warning: useless use of a literal in void context
が出るときに 1.9 だと何も出ません。

% ruby18 -ve '1'
ruby 1.8.8dev (2009-06-23 revision 23825) [i686-linux]
-e:1: warning: useless use of a literal in void context
% ruby-trunk -ve '1'
ruby 1.9.2dev (2009-06-24 trunk 23837) [i686-linux]
%
=end

History

#1

Updated by matz (Yukihiro Matsumoto) over 10 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r23864.
=end

#2

Updated by matz (Yukihiro Matsumoto) over 10 years ago

  • Status changed from Closed to Open

=begin
wrong ML ref
=end

#3

Updated by yugui (Yuki Sonoda) over 10 years ago

  • Assignee set to matz (Yukihiro Matsumoto)
  • Target version set to 1.9.2

=begin
意図されたことでしょうか? < まつもとさん
=end

#4

Updated by mame (Yusuke Endoh) over 9 years ago

  • Assignee changed from matz (Yukihiro Matsumoto) to nobu (Nobuyoshi Nakada)

=begin
遠藤です。

r23474 の影響のようで、意図されたことではないと思います。

パッチにはあまり自信ありませんが、なかださんどうでしょうか。

diff --git a/parse.y b/parse.y
index c88a727..cb49fa1 100644
--- a/parse.y
+++ b/parse.y
@@ -785,8 +785,7 @@ static void token_info_pop(struct parser_params*, const char token);
program : {
lex_state = EXPR_BEG;
/
%%%*/

  • $$ = compile_for_eval || rb_parse_in_main();
  • local_push($$);
  • local_push(compile_for_eval || rb_parse_in_main()); /% local_push(0); %/ @@ -794,7 +793,7 @@ program : { top_compstmt { /%%%/
  • if ($2 && !$1) {
  • if ($2 && !compile_for_eval) { /* last expression should not be void */ if (nd_type($2) != NODE_BLOCK) void_expr($2); else {

--
Yusuke Endoh mame@tsg.ne.jp
=end

#5

Updated by mame (Yusuke Endoh) over 9 years ago

  • Status changed from Open to Closed

=begin
This issue was solved with changeset r27504.
Kazuhiro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Also available in: Atom PDF