1. 4.0 Beta 2 Due Out on Tuesday, got your bug reports in?

Just a reminder, 4.0 beta 2 is due out on Tuesday, 8/25/2009.

Have you submitted any bugs to the Bug Tracker that you may know of?

Jeremy

new topic     » topic index » view message » categorize

2. Re: 4.0 Beta 2 Due Out on Tuesday, got your bug reports in?

The "variable not used" bug reported by CrisB was ambiguously entered into the bug reports. The warning is properly triggered since the declared variable never appears to the right of an equals sign. The bug is that "without warning" fails to suppress the post-execution warning massage.

new topic     » goto parent     » topic index » view message » categorize

3. Re: 4.0 Beta 2 Due Out on Tuesday, got your bug reports in?

kenneth said...

The "variable not used" bug reported by CrisB was ambiguously entered into the bug reports. The warning is properly triggered since the declared variable never appears to the right of an equals sign. The bug is that "without warning" fails to suppress the post-execution warning massage.

Yeah, I realized that too. I'll tidy up the bug report to clarify it.

However, have we really got a bug here?

The not-used checking is done at the end of each block using whatever warning settings are prevailing at the time. In other words, the warning settings are linked to a block of code and not individual declarations.

In this case, the variable is scoped to the file, and the file's block is checked after the all the file has been parsed. The problem with this particular file is not that the without warning is failing, but that the last line in the module is with warning. Meaning that when the not-used checking is being performed for this file's block, the warnings have been explicitly set to check for unused variables. Now, if that last line is removed, you won't get the message.

new topic     » goto parent     » topic index » view message » categorize

4. Re: 4.0 Beta 2 Due Out on Tuesday, got your bug reports in?

Hi

Oh, I see, so with warning effectively overrides without warning. I would say however there is an ambiguity in there, since the code with the 'disputed' variable occurs after the without warning, so without warning should turn off warnings until they are turned back on again with with warning. This just seems the logical way to do it to me. Maybe not the easier way though.

someone said...

The warning is properly triggered since the declared variable never appears to the right of an equals sign.

Yes it does though

-- variables and routines used in safe.e 
without warning 
integer check_calls 
check_calls = 1 

Chris

new topic     » goto parent     » topic index » view message » categorize

5. Re: 4.0 Beta 2 Due Out on Tuesday, got your bug reports in?

ChrisB said...

Oh, I see, so with warning effectively overrides without warning.

Yes, and does that surprise you? The reverse is also true - without warning overrides with warning

ChrisB said...

I would say however there is an ambiguity in there, since the code with the 'disputed' variable occurs after the without warning, so without warning should turn off warnings until they are turned back on again with with warning. This just seems the logical way to do it to me. Maybe not the easier way though.

That is exactly what is happening already. The usage checking occurs whenever a block of code ends - such as the end of a routine, a 'switch', a loop, a source file, ... When a block ends, usage of variables declared in that block is checked using whatever the warning setting is at that time.

In this specific instance, just before the end of the file, the warnings are turned on. So when the end of file is reached, Euphoria checks the usage of variables declared at the file level, based on that with warnings statement. Thus we get the message. This is not a bug in the warning reporting system. If anything is a bug it is that final line of code. It should be removed.

But that begs the question, "why is check_calls declared at all and why is it assigned anything?" Both the declaration and the assignment are redundant and could be seen as a coding mistake - thus the warning.

Now consider what you seem to be asking for - that declarations occuring whilst a without warning is active should be immune from usage checking.

---- file begins ---- 
without warning 
integer foo 
procA() 
with warning 
procB() 
---- file ends ---- 

When this file ends, foo is still not used and warnings are on. So should a message be issued or not? Remember, usage checking occurs at the end of a block, which is when variables go out of scope. (Of course none of this applies to exposed variables - global, public, or export ones.) If we didn't do usage checking at the end of a block, when else could be do it? It doesn't make sense to do it while a variable is still in scope because it cound have been used after the usage check.

It is hard to see the intention of the author of v3 machine.e, but I think what was being attempted by the final with warning was to restore the warnings to whatever they were when the file began. But as you can see, this is not the way that usage checking works. Now, in OpenEuphoria v4 we have better ways to do that sort of thing.

---- file begins ---- 
with warning save -- Save whatever warnings are active 
without warning 
integer foo 
procA() 
with warning restore -- Restore from the last save point. 
procB() 
---- file ends ---- 
ChrisB said...
someone said...

The warning is properly triggered since the declared variable never appears to the right of an equals sign.

Yes it does though

-- variables and routines used in safe.e 
without warning 
integer check_calls 
check_calls = 1 

What do you mean by "Yes it does though"? The example code you supplied does not issue any warning message.

By the way, OpenEuphoria now issues differently worded messages now ...

-- variables and routines used in safe.e 
with warning 
integer check_calls 
check_calls = 1 

Warning ( not_used ): 
    <0320>:: testw.ex - module variable 'check_calls' is assigned but never used 

-- variables and routines used in safe.e 
with warning 
integer check_calls 

Warning ( not_used ): 
    <0229>:: testw.ex - module variable 'check_calls' is not used 

new topic     » goto parent     » topic index » view message » categorize

6. Re: 4.0 Beta 2 Due Out on Tuesday, got your bug reports in?

OK

With ref to

The warning is properly triggered since the declared variable never appears to the right of an equals sign. Yes it does though

variables and routines used in safe.e without warning integer check_calls check_calls = 1

I crashed the forum so was unable to continue the post. The statement was that the variable doesn't appear to the right of an equals sign. Why should this matter? Assigning it is using it in my book.

I was also not aware of with warning save, and without warning save.

Never mind. I shall accept these are the way things are now, and make sure that without warnings is turned on universally.

Chris

new topic     » goto parent     » topic index » view message » categorize

7. Re: 4.0 Beta 2 Due Out on Tuesday, got your bug reports in?

ChrisB said...

I crashed the forum so was unable to continue the post. The statement was that the variable doesn't appear to the right of an equals sign. Why should this matter? Assigning it is using it in my book.

But it really isn't. If you assign it and never use it, then what was the point of assigning it? It didn't really do anything (in most cases, at least). This is a pretty standard sort of warning, which lets you know that you can probably remove the referenced variable from your code altogether.

Matt

new topic     » goto parent     » topic index » view message » categorize

8. Re: 4.0 Beta 2 Due Out on Tuesday, got your bug reports in?

ChrisB said...

With ref to

The warning is properly triggered since the declared variable never appears to the right of an equals sign.
Yes it does though

-- variables and routines used in safe.e  
without warning  
integer check_calls  
check_calls = 1  

I crashed the forum so was unable to continue the post. The statement was that the variable doesn't appear to the right of an equals sign. Why should this matter? Assigning it is using it in my book.

Firstly, there are distinct messages now. One when a var is not used in any manner, and another when it is only ever assigned to but never read.

What is the point of assigning something to a local variable but never using that value? Either it is a mistake by the coder or the coder is not aware of the useless code. Of course, the coder could be doing this on purpose which makes me very wary of their coding skill.

ChrisB said...

I was also not aware of with warning save, and without warning save.

Never mind. I shall accept these are the way things are now, and make sure that without warnings is turned on universally.

There is no need to have without warning always turned on. Be default, it is turned off at the beginning of each file.

Try this ...

integer check_calls  
check_calls = 1  

Look, no messages get displayed!

new topic     » goto parent     » topic index » view message » categorize

9. Re: 4.0 Beta 2 Due Out on Tuesday, got your bug reports in?

someone saidThe warning is properly triggered since the declared variable never appears to the right of an equals sign.

Chris saidYes it does though

found in safe.e (and machine.e) without warning integer check_calls check_calls = 1

someone repliesYou seem to be confusing left vs. right. I could have said the variable check_calls is never assigned to anything or used in any calculation or that it is never an rvalue. So 'unused' is a proper warning. At any rate, Jeremy points out that the problem is not the 'without warning' implementation, but rather the lack of documentation regarding its scope and its subsequent misuse in the two mentioned include files.

new topic     » goto parent     » topic index » view message » categorize

10. Re: 4.0 Beta 2 Due Out on Tuesday, got your bug reports in?

Its Tuesday, is Beta 2 gonna be coming out here soon?

new topic     » goto parent     » topic index » view message » categorize

11. Re: 4.0 Beta 2 Due Out on Tuesday, got your bug reports in?

Lone_EverGreen_Ranger said...

Its Tuesday, is Beta 2 gonna be coming out here soon?

We have a show stopping bug that we are trying to work through. With the latest information that we were able to gather, it seems to be affecting Windows Vista and Windows 7 users. So, if we do not get it solved by tomorrow, I *think* we will probably release beta 2 with that warning.

Jeremy

new topic     » goto parent     » topic index » view message » categorize

12. Re: 4.0 Beta 2 Due Out on Tuesday, got your bug reports in?

jeremy said...
Lone_EverGreen_Ranger said...

Its Tuesday, is Beta 2 gonna be coming out here soon?

We have a show stopping bug that we are trying to work through. With the latest information that we were able to gather, it seems to be affecting Windows Vista and Windows 7 users. So, if we do not get it solved by tomorrow, I *think* we will probably release beta 2 with that warning.

Jeremy

Ah ok. Seems like a bug always appears at the last minute. Also, I forgot to ask, will the new win32lib compatible with Eu 4.0, be out as well?

new topic     » goto parent     » topic index » view message » categorize

13. Re: 4.0 Beta 2 Due Out on Tuesday, got your bug reports in?

Hi, This may be a bug in v4.0b1.. On my CentOS 5.3 x32, with Gnome desktop, the screen display gets altered. When trace(1) is invoked, the screen changes to the usual trace, no problem. But if I "q" to get out of the trace, my screen which was black chars on white background is now black with grey chars. If I then do a "ls", the ls results are back to black on white, while the rest of the screen is grey on black. Or is this some sort of display setting I need to sort out?

Regards Alan

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu