From: Ann H. <har...@ne...> - 2000-08-28 20:03:10
|
At 05:24 PM 8/26/00 +1000, Mark O'Donohue wrote: >Here are some more changes for the "no effects" warning removals. > error_type == "table"; > error_type == "procedure"; > error_type == "context"; The compiler we used when I was learning C didn't report a warning for that sort of idiocy. After I'd been working in gpre for about six months, Jim found that error in something I'd coded - gave me public hell about it (everything was public - we were a two room company and the walls were tissue paper). He insisted I go over every piece of code I had written and check that I had assignment and comparison correct. Actually, thinking about it, I'd done the opposite - assigned where I should have compared. >In burp/backup.e > >The following code occurs in two places: > > STUFF (name_len); > for (; c = *name++, name_len--; name_len) > STUFF (c); > >Obvioulsy the ; name_len) does nothing. > >Changed to: > > STUFF (name_len); > for (; c = *name++, name_len--;) > STUFF (c); My preference, when a for loop degenerates to its exit condition is to change loop types. >In burp/burp.c > > for (p = redirect, string = OUTPUT_SUPPRESS, >tdgbl->sw_redirect = NOOUTPUT; c = *p++; *string) > { > if (UPPER (c) != *string++) > { > tdgbl->sw_redirect = TRUE; > break; > } > } > > >Changed to: > > for (p = redirect, string = OUTPUT_SUPPRESS, tdgbl->sw_redirect = >NOOUTPUT; c = *p++; ) Again, I'd put the two setup statements outside the loop and have something clear like while (c = *p++) >In dudley/parse.c > >static FUNCARG parse_function_arg ( > FUNC function, > USHORT *position) >{ >... > >KEYWORD (KW_BY); >LEX_token(); The lexeme "by" is used in the GDL (groton data language) in two ways: a column can be COMPUTED [BY] an expression and a function parameter can be passed [BY] {VALUE | REFERENCE ...} The wrong macro is used here. It should be MATCH (KW_BY) which is the way to skip a noise word. >In isql/isql.e > >void ISQL_warning ( STATUS *status) { >... > status[2] == gds_arg_end; >Changed to: > status[2] = gds_arg_end; Exactly. >In qli/meta.e > >The statement >length; >doesn't add a lot of value in the function make_symbol >But tell you what I'll be pissed off if Inprise take just this and say >"thanks sucker" just another free developer to add value to an Inprise >product. You expect thanks from them? Ann |