Project

General

Profile

Actions

Bug #1692

closed

warning: useless use of a literal in void context

Added by znz (Kazuhiro NISHIYAMA) over 15 years ago. Updated over 13 years ago.

Status:
Closed
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

Actions #1

Updated by matz (Yukihiro Matsumoto) over 15 years ago

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

=begin
Applied in changeset r23864.
=end

Actions #2

Updated by matz (Yukihiro Matsumoto) over 15 years ago

  • Status changed from Closed to Open

=begin
wrong ML ref
=end

Actions #3

Updated by yugui (Yuki Sonoda) over 15 years ago

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

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

Actions #4

Updated by mame (Yusuke Endoh) over 14 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;
/
%%%*/

  •  	$<num>$ = compile_for_eval || rb_parse_in_main();
    
  •  	local_push($<num>$);
    
  •  	local_push(compile_for_eval || rb_parse_in_main());
         /*%
     	local_push(0);
         %*/
    

@@ -794,7 +793,7 @@ program : {
top_compstmt
{
/%%%/

  •  	if ($2 && !$<num>1) {
    
  •  	if ($2 && !compile_for_eval) {
     	    /* last expression should not be void */
     	    if (nd_type($2) != NODE_BLOCK) void_expr($2);
     	    else {
    

--
Yusuke Endoh
=end

Actions #5

Updated by mame (Yusuke Endoh) over 14 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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0