Branch: Tag:

2018-02-14

2018-02-14 15:12:21 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Revert "Compiler: Added Pike 8.0 compat for is_const() change."

This is obsolete when 6ac3cfe111ffebcb457701ea2cbe3a01a57fdb44 is reverted.

This reverts commit 2984f30cbe903776c0e678b444bba26c7d7d60a2.

581:    Pike_compiler->current_modifiers & ~ID_EXTERN);    }    } else { -  int warn = 0; -  if(!is_const($3) && !(warn = (TEST_COMPAT(8, 0) && is_const_80($3)))) { +  if(!is_const($3)) {    if (Pike_compiler->compiler_pass == COMPILER_PASS_LAST) {    yyerror("Constant definition is not constant.");    }
591:    } else {    if(!Pike_compiler->num_parse_error)    { -  ptrdiff_t tmp; -  if (warn) { -  yywarning("Constant expression has external dependencies."); -  } -  tmp = eval_low($3,1); +  ptrdiff_t tmp=eval_low($3,1);    if(tmp < 1)    {    yyerror("Error in constant definition.");
1872:   local_constant_name: TOK_IDENTIFIER '=' safe_expr0    {    struct pike_type *type; -  int warn = 0; +        /* Ugly hack to make sure that $3 is optimized */    {
1883:    type=$3->u.node.a->type;    }    -  if(!is_const($3) && !(warn = (TEST_COMPAT(8, 0) && is_const_80($3)))) +  if(!is_const($3))    {    if(Pike_compiler->compiler_pass == COMPILER_PASS_LAST) -  my_yyerror("Constant definition is not constant: 0x%08x.", -  $3?$3->tree_info:0); +  yyerror("Constant definition is not constant.");    }else{ -  ptrdiff_t tmp; -  if (warn) { -  yywarning("Constant expression has external dependencies."); -  } -  tmp = eval_low($3,1); +  ptrdiff_t tmp=eval_low($3,1);    if(tmp < 1)    {    yyerror("Error in constant definition.");
2935:    {    if ($1) {    if ($2) { -  int warn = 0; +     /* Explicit enum value. */       /* This can be made more lenient in the future */
2947:    Pike_compiler->compiler_pass=tmp;    }    -  if(!is_const($2) && !(warn = (TEST_COMPAT(8, 0) && is_const_80($2)))) +  if(!is_const($2))    {    if(Pike_compiler->compiler_pass == COMPILER_PASS_LAST)    yyerror("Enum definition is not constant.");
2955:    } else {    if(!Pike_compiler->num_parse_error)    { -  ptrdiff_t tmp; -  if (warn) { -  yywarning("Constant expression has external dependencies."); -  } -  tmp = eval_low($2,1); +  ptrdiff_t tmp=eval_low($2,1);    if(tmp < 1)    {    yyerror("Error in enum definition.");