Re: [perl #53356] Misc. build warnings

2008-04-28 Thread chromatic
On Monday 28 April 2008 10:40:02 [EMAIL PROTECTED] wrote:

 Just a query, wouldn't:
 Index: src/key.c
 ===
 --- src/key.c   (revision 27216)
 +++ src/key.c   (working copy)
 @@ -329,12 +329,14 @@
  }
  case KEY_start_slice_FLAG:
  case KEY_inf_slice_FLAG:
 +{
 +return VTABLE_get_integer(interp, key);
 +}
  default:
 -break;
 +return VTABLE_get_integer(interp, key);
  }
  }

 -return VTABLE_get_integer(interp, key);
  }


 be a little better?

What if the PMC passed in isn't a Key PMC, but has an integer value?

-- c


Re: [perl #53356] Misc. build warnings

2008-04-28 Thread Andy_Bach
On 26 April 2008 chromatic wrote:
 src/key.c:306: warning: switch missing default case

Fixed in 27195.


Just a query, wouldn't:
Index: src/key.c
===
--- src/key.c   (revision 27216)
+++ src/key.c   (working copy)
@@ -329,12 +329,14 @@
 }
 case KEY_start_slice_FLAG:
 case KEY_inf_slice_FLAG:
+{
+return VTABLE_get_integer(interp, key);
+}
 default:
-break;
+return VTABLE_get_integer(interp, key);
 }
 }

-return VTABLE_get_integer(interp, key);
 }


be a little better?  When I was trying to figure this out before (perl 
#52710 - which can be closed now), I was hung up on why there were KEY_* 
values being passed in that didn't have KEY_flags values. I was trying to 
match the usage of default in:
key_number(PARROT_INTERP, ARGIN(PMC *key))
{
switch (PObj_get_FLAGS(key)  KEY_type_FLAGS) {

   default:
real_exception(interp, NULL, INVALID_OPERATION, Key not a 
number!\n);
}


At least by leaving it a separate section, not combined w/ 
start_slice|inf_slice, if it turns out that there's a 'missing' flag or 
something. It'll be more obvious??? In any case, the final
  return VTABLE_get_integer(interp, key);

shouldn't be needed, right?

a
---
Andy Bach
Systems Mangler
Internet: [EMAIL PROTECTED]
Voice: (608) 261-5738 Fax: 264-5932

When angry, count to four; when very angry, swear.
Mark Twain



Re: [perl #53356] Misc. build warnings

2008-04-28 Thread Andy_Bach
chromatic wrote
 What if the PMC passed in isn't a Key PMC, but has an integer value?

Ah (sound of scales falling from my eyes) - the reason for the 
test/switch:
  if (VTABLE_isa(interp, key, CONST_STRING(interp, Key))) {
switch (PObj_get_FLAGS(key)  KEY_type_FLAGS) {
...

is to handle cases where the key needs special handling. But 
non-KEY_flag values (non-KEY pmcs?) passed to key_integer are *not* a 
problem.

never mind

a
---
Andy Bach
Systems Mangler
Internet: [EMAIL PROTECTED]
Voice: (608) 261-5738 Fax: 264-5932

When angry, count to four; when very angry, swear.
Mark Twain



Re: [perl #53356] Misc. build warnings

2008-04-26 Thread chromatic
On Friday 25 April 2008 10:50:24 Will Coleda wrote:

 Miscellaneous build warnings that need to be cleaned up.

 src/key.c:306: warning: switch missing default case

Fixed in 27195.

 compilers/imcc/imclexer.c:4288: warning: switch missing default case
 compilers/imcc/imclexer.c:4447: warning: comparison between signed and
 unsigned compilers/imcc/imclexer.c:4615: warning: switch missing default
 case

These are all in generated code.  I suspect we're not going to clear these up 
without patching lex/flex or writing a filter for post-generation.  You can 
quote me on this: yuck.

-- c


Re: [perl #53356] Misc. build warnings

2008-04-26 Thread Klaas-Jan Stol
On Sat, Apr 26, 2008 at 7:39 PM, chromatic [EMAIL PROTECTED] wrote:
 On Friday 25 April 2008 10:50:24 Will Coleda wrote:

   Miscellaneous build warnings that need to be cleaned up.
  
   src/key.c:306: warning: switch missing default case

  Fixed in 27195.


   compilers/imcc/imclexer.c:4288: warning: switch missing default case
   compilers/imcc/imclexer.c:4447: warning: comparison between signed and
   unsigned compilers/imcc/imclexer.c:4615: warning: switch missing default
   case

  These are all in generated code.  I suspect we're not going to clear these up
  without patching lex/flex or writing a filter for post-generation.  You can
  quote me on this: yuck.

  -- c


In my experience, compiling a flex-generated lexer with -Wall flag on
msvc should not emit these warnings in a normal situation; in other
words, I'm fairly sure (but not absolutely sure) that this can be
fixed without a filter.

kjs