MantisBT - opensim
View Issue Details
0008336opensim[MISC] Compiling / Buildingpublic2018-07-11 02:572018-07-11 06:59
Garmin Kawaguichi 
UbitUmarov 
lowminoralways
resolvedfixed 
0.9.0.1 
 
Standalone (Multiple Regions)
BulletSim
.NET / Windows64
None
0008336: Just for fun
OpenSim\Region\ScriptEngine\Shared\CodeTools\lsl.lexer.cs

Line 19728-19729 in public override TOKEN OldAction(Lexer yym,ref string yytext,int action, ref bool reject) {

We have found:
   case 1032: { yym.yy_begin("YYINITIAL"); ((LSLTokens)yym).yytext = ((LSLTokens)yym).str; ((LSLTokens)yym).str = String.Empty; return new STRING_CONSTANT(yym); }
      break;

A break after a return ? Yeap… but no !
(IV)
 
No tags attached.
Issue History
2018-07-11 02:57Garmin KawaguichiNew Issue
2018-07-11 03:35UbitUmarovNote Added: 0032764
2018-07-11 03:35Fly-Man-Note Added: 0032765
2018-07-11 03:35Fly-Man-Statusnew => acknowledged
2018-07-11 05:06Garmin KawaguichiNote Added: 0032768
2018-07-11 05:39tampaNote Added: 0032770
2018-07-11 05:51Garmin KawaguichiNote Added: 0032772
2018-07-11 06:06tampaNote Added: 0032773
2018-07-11 06:59UbitUmarovNote Added: 0032774
2018-07-11 06:59UbitUmarovNote Added: 0032775
2018-07-11 06:59UbitUmarovStatusacknowledged => resolved
2018-07-11 06:59UbitUmarovResolutionopen => fixed
2018-07-11 06:59UbitUmarovAssigned To => UbitUmarov

Notes
(0032764)
UbitUmarov   
2018-07-11 03:35   
may look ugly but ok
specially on a generated file


you may also find it no other places
(0032765)
Fly-Man-   
2018-07-11 03:35   
That break is there for a reason, the LSL Lexer creator has explained that it's a known warning and wont be fixed.
(0032768)
Garmin Kawaguichi   
2018-07-11 05:06   
Ok I understand that, but he could write something like that to avoid the warning::

   case 1032: { yym.yy_begin("YYINITIAL"); ((LSLTokens)yym).yytext = ((LSLTokens)yym).str; ((LSLTokens)yym).str = String.Empty; return new STRING_CONSTANT(yym); }
#pragma warning disable CS0162 // Unreachable code detected
      break;
#pragma warning restore CS0162 // Unreachable code detected
   case 1027: { ((LSLTokens)yym).str += '\\'; }
--------------
In addition, a class name must start with a capital letter
Line 381
public class yyLSLTokens : YyLexer {
--------------
(IV)
(0032770)
tampa   
2018-07-11 05:39   
You could be a bit more descriptive with your titles so they actually make sense in review. If you are going through the code just to find the small naming failures and other odd code then you are in for some fun. Would make more sense to spend the effort toward improving the almost decade old documentation and actually document some of the code and functionality that has yet to even receive documentation. :)
(0032772)
Garmin Kawaguichi   
2018-07-11 05:51   
Sure, you're right! But it's more fun to have a compilation with no error, no warning and no message.
If not, it means that something you have done has impacted the code elsewhere (assuming that you have previously considered errors in your changes).

(IV)
(0032773)
tampa   
2018-07-11 06:06   
Warngins =/= bad code, depending on which compiler you use and how your build environment is configured you may get more or less. Historically there were almost ten times the warnings, I pushed last year to have most of them cleared out so the actual issues would become more apparent later on, you can go back to the commits about the "Pesky warnings".

Very few issues actually stem from compile warnings now, most of what I encounter is generally to do with code that was either rushed or not well planned, little things here and there, again just read some recent commits. What functionality there should be vs. what there actually is, that's pretty much the phase the project is in currently.

Feel free to join the irc channel on freenode #opensim-dev if you want to discuss more about the current status of the project and where help and testing may be needed :)
(0032774)
UbitUmarov   
2018-07-11 06:59   
warnings are just that warnings.
some may be very relevant, others not really
keeping them low improves the visibilty of the most relevant ones.

like fly-man said this one is on a generated file, and the author of the tool refers it as "feature"


and opensim without any warning? ppl whould not accept it as valid opensim
;)

and i can make some 3000 to so showup on this same code...
(0032775)
UbitUmarov   
2018-07-11 06:59   
pet warning