warnings which don't help user to undesrtand where the problem is

View: New views
12 Messages — Rating Filter:   Alert me  

warnings which don't help user to undesrtand where the problem is

by Sergei Steshenko-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello All,

running a script of mine I've seen these warnings:

warning: range error for conversion to character value
warning: implicit conversion from scalar to string

.

I'd expect at least function name (either in 'octave' or in C++) of the
function emitting such warnings.

Thanks,
  Sergei.


     
_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

Re: warnings which don't help user to undesrtand where the problem is

by Ben Abbott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jan 3, 2009, at 8:19 PM, Sergei Steshenko wrote:

> Hello All,
>
> running a script of mine I've seen these warnings:
>
> warning: range error for conversion to character value
> warning: implicit conversion from scalar to string
>
> .
>
> I'd expect at least function name (either in 'octave' or in C++) of  
> the
> function emitting such warnings.
>
> Thanks,
>  Sergei.

Sergei,

Can you reproduce the problem with a simple example?

As it is, the text for the first error exists in several places.

ov-float.cc
ov-flt-re-mat.cc
ov-re-mat.cc
ov-scalar.cc
ov-base-int.cc
ov-re-sparse.cc

Regarding the text for the second warning, I can't find it in any of  
the sources.

Ben

_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

Re: warnings which don't help user to undesrtand where the problem is

by Sergei Steshenko-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message




--- On Sat, 1/3/09, Ben Abbott <bpabbott@...> wrote:

> From: Ben Abbott <bpabbott@...>
> Subject: Re: warnings which don't help user to undesrtand where the problem is
> To: sergstesh@...
> Cc: bug-octave@...
> Date: Saturday, January 3, 2009, 5:57 PM
> On Jan 3, 2009, at 8:19 PM, Sergei Steshenko wrote:
>
> > Hello All,
> >
> > running a script of mine I've seen these warnings:
> >
> > warning: range error for conversion to character value
> > warning: implicit conversion from scalar to string
> >
> > .
> >
> > I'd expect at least function name (either in
> 'octave' or in C++) of the
> > function emitting such warnings.
> >
> > Thanks,
> >  Sergei.
>
> Sergei,
>
> Can you reproduce the problem with a simple example?
>
> As it is, the text for the first error exists in several
> places.
>
> ov-float.cc
> ov-flt-re-mat.cc
> ov-re-mat.cc
> ov-scalar.cc
> ov-base-int.cc
> ov-re-sparse.cc
>
> Regarding the text for the second warning, I can't find
> it in any of the sources.
>
> Ben

sprintf("%s", 1)
warning: implicit conversion from scalar to string

;
I am not sure what caused the first warning - I have already fixed the
script.

All the functions that "do not introduce themselves" should be fixed
regardless of present text of warnings.

Thanks,
  Sergei.


     
_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

Re: warnings which don't help user to undesrtand where the problem is

by Sergei Steshenko-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message




--- On Sat, 1/3/09, Ben Abbott <bpabbott@...> wrote:

> From: Ben Abbott <bpabbott@...>
> Subject: Re: warnings which don't help user to undesrtand where the problem is
> To: sergstesh@...
> Cc: bug-octave@...
> Date: Saturday, January 3, 2009, 5:57 PM
> On Jan 3, 2009, at 8:19 PM, Sergei Steshenko wrote:
>
> > Hello All,
> >
> > running a script of mine I've seen these warnings:
> >
> > warning: range error for conversion to character value
> > warning: implicit conversion from scalar to string
> >
> > .
> >
> > I'd expect at least function name (either in
> 'octave' or in C++) of the
> > function emitting such warnings.
> >
> > Thanks,
> >  Sergei.
>
> Sergei,
>
> Can you reproduce the problem with a simple example?
>
> As it is, the text for the first error exists in several
> places.
>
> ov-float.cc
> ov-flt-re-mat.cc
> ov-re-mat.cc
> ov-scalar.cc
> ov-base-int.cc
> ov-re-sparse.cc
>
> Regarding the text for the second warning, I can't find
> it in any of the sources.
>
> Ben

Both:

sprintf("%s", 1000000000000)
warning: range error for conversion to character value
warning: implicit conversion from scalar to string

--Sergei.


     
_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

Re: warnings which don't help user to undesrtand where the problem is

by Ben Abbott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jan 3, 2009, at 9:54 PM, Sergei Steshenko wrote:

> --- On Sat, 1/3/09, Ben Abbott <bpabbott@...> wrote:
>
>> From: Ben Abbott <bpabbott@...>
>> Subject: Re: warnings which don't help user to undesrtand where the  
>> problem is
>> To: sergstesh@...
>> Cc: bug-octave@...
>> Date: Saturday, January 3, 2009, 5:57 PM
>> On Jan 3, 2009, at 8:19 PM, Sergei Steshenko wrote:
>>
>>> Hello All,
>>>
>>> running a script of mine I've seen these warnings:
>>>
>>> warning: range error for conversion to character value
>>> warning: implicit conversion from scalar to string
>>>
>>> .
>>>
>>> I'd expect at least function name (either in
>> 'octave' or in C++) of the
>>> function emitting such warnings.
>>>
>>> Thanks,
>>> Sergei.
>>
>> Sergei,
>>
>> Can you reproduce the problem with a simple example?
>>
>> As it is, the text for the first error exists in several
>> places.
>>
>> ov-float.cc
>> ov-flt-re-mat.cc
>> ov-re-mat.cc
>> ov-scalar.cc
>> ov-base-int.cc
>> ov-re-sparse.cc
>>
>> Regarding the text for the second warning, I can't find
>> it in any of the sources.
>>
>> Ben
>
> sprintf("%s", 1)
> warning: implicit conversion from scalar to string
>
> ;
> I am not sure what caused the first warning - I have already fixed the
> script.
>
> All the functions that "do not introduce themselves" should be fixed
> regardless of present text of warnings.
>
> Thanks,
>  Sergei.

I agree. I'm often frustrated looking for where an error or warning  
occurred.

Any chance you might be interested in contributing by searching the  
sources for such things and adding context to the warning/error  
messages?

 From an architectural perspective my role in with octave is  
meaningless. Instead I focus on tying up such loose ends.  
Surprisingly, and to my benefit as I enjoy it, there are sufficient  
"loose ends" to keep me and many more occupied for a long time.

If you are inclined, you attention to detail would be greatly  
beneficial to the development of Octave.

Ben



_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

Re: warnings which don't help user to undesrtand where the problem is

by bugs_bunny :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I just found this bug on google and since you posted it only 2 days ago I'd like to ask you how you'd solved it. I still get "warning: implicit conversion from scalar to string" when I use the functions:

[charc, count] = fscanf (FID, "%c", 1);
[header, count] = fscanf (FID, "%s\n", 1);

I don't see any other way to write the syntax. The program works though, it is only annoying.

I use GNU Octave, version 2.1.53 (powerpc-apple-darwin7.2.0). I checked for updates, but there were no packages to install.

Sergei Steshenko-2 wrote:
Both:

sprintf("%s", 1000000000000)
warning: range error for conversion to character value
warning: implicit conversion from scalar to string

--Sergei.

Re: warnings which don't help user to undesrtand where the problem is

by Sergei Steshenko-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message




--- On Mon, 1/5/09, bugs_bunny <isgoed@...> wrote:

> From: bugs_bunny <isgoed@...>
> Subject: Re: warnings which don't help user to undesrtand where the problem is
> To: bug-octave@...
> Date: Monday, January 5, 2009, 5:43 AM
> I just found this bug on google and since you posted it only
> 2 days ago I'd
> like to ask you how you'd solved it. I still get
> "warning: implicit
> conversion from scalar to string" when I use the
> functions:
>
> [charc, count] = fscanf (FID, "%c", 1);
> [header, count] = fscanf (FID, "%s\n", 1);
>
> I don't see any other way to write the syntax. The
> program works though, it
> is only annoying.
>
> I use GNU Octave, version 2.1.53
> (powerpc-apple-darwin7.2.0). I checked for
> updates, but there were no packages to install.
>
>
> Sergei Steshenko-2 wrote:
> >
> > Both:
> >
> > sprintf("%s", 1000000000000)
> > warning: range error for conversion to character value
> > warning: implicit conversion from scalar to string
> >
> > --Sergei.
> >
>
> --
> View this message in context:
> http://www.nabble.com/warnings-which-don%27t-help-user-to-undesrtand-where-the-problem-is-tp21271788p21291235.html
> Sent from the Octave - Bugs mailing list archive at
> Nabble.com.
>
> _______________________________________________
> Bug-octave mailing list
> Bug-octave@...
> https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

The fact that your program works does not mean it is correct.

In my case the warnings indicated a problem in my code, i.e. the warnings
were justified, they just didn't help much to clearly identify the exact
location of the problems in my code.

I guess the data you read with 'fscanf' is not compatible with the
format you specified in 'fscanf' call, but to verify this guess you need
to publish data in the file pointed to by FID.

--Sergei.


     
_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

Re: warnings which don't help user to undesrtand where the problem is

by Ben Abbott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jan 5, 2009, at 8:43 AM, bugs_bunny wrote:

> I use GNU Octave, version 2.1.53 (powerpc-apple-darwin7.2.0). I  
> checked for
> updates, but there were no packages to install.

There is certainly an update. The current release is 3.0.3.

How did you check for an update? Are you running Fink or Darwin/
MacPorts?

If not, follow the link below and install the Ocave.app from  
Sourceforge.

        http://sourceforge.net/project/showfiles.php?group_id=2888&package_id=237839

Ben
_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

Re: warnings which don't help user to undesrtand where the problem is

by bugs_bunny :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message




>
> On Jan 5, 2009, at 8:43 AM, bugs_bunny wrote:
>
>> I use GNU Octave, version 2.1.53 (powerpc-apple-darwin7.2.0). I  
>> checked for
>> updates, but there were no packages to install.
>
> There is certainly an update. The current release is 3.0.3.
>
> How did you check for an update? Are you running Fink or  
> Darwin/MacPorts?
>
> If not, follow the link below and install the Ocave.app from  
> Sourceforge.
>
> http://sourceforge.net/project/showfiles.php?
> group_id=2888&package_id=237839
>
> Ben
>

I use Fink 0.23.6:

[domain:~] user% fink update octave
Password:
Information about 2072 packages read in 8 seconds.
No packages to install.
[domain:~] user%

I have downloaded octave 3.0.3 but that only makes things worse.

-*- The bug I had with fscanf is gone. I read on the internet that it  
was a problem with 2.1.52 (and later)

-*- opening octave from the command line still loads octave 2.1.53

-*- the statement if(charc == '\n') is no longer true if charc is  
indeed a newline (see code below, \n is now read as 2 characters)

-*- I now get warnings on any string definition like:

octave-3.0.3:17> a = 'hello'
warning: single quote delimited string near line 17
a = hello
octave-3.0.3:18> a = "hello"
warning: potential Matlab compatibility problem: " used as string  
delimiter
a = hello
octave-3.0.3:20> int8('\n')
warning: single quote delimited string near line 20
ans =

    92  110

octave-3.0.3:21> int8("\n")
warning: potential Matlab compatibility problem: " used as string  
delimiter
ans = 10
octave-3.0.3:22>

I can use  warning ("off"); around any string definition but that is  
very annoying.
The setting warning ("off", "Octave:num-to-str"); did not work by the  
way

Can anyone tell me how I can use strings without getting my screan  
clogged with warnings.
Or does anyone have a script that can read oommf .omf .ohf vector files?

>> "warning: implicit
>> conversion from scalar to string" when I use the
>> functions:
>>
>> [charc, count] = fscanf (FID, "%c", 1);
>> [header, count] = fscanf (FID, "%s\n", 1);
>>
>> I don't see any other way to write the syntax. The
>> program works though, it
>> is only annoying.
>
> The fact that your program works does not mean it is correct.
>
> In my case the warnings indicated a problem in my code, i.e. the  
> warnings
> were justified, they just didn't help much to clearly identify the  
> exact
> location of the problems in my code.
>
> I guess the data you read with 'fscanf' is not compatible with the
> format you specified in 'fscanf' call, but to verify this guess you  
> need
> to publish data in the file pointed to by FID.
>
> --Sergei.

Reading a string or character should work with any data. Try for  
example 'r'. It might be though that for numbers no error is given, but  
I have not tested that.


Steven Verstoep

_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

Re: warnings which don't help user to undesrtand where the problem is

by bugs_bunny :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


>
> I have downloaded octave 3.0.3 but that only makes things worse.
>
> -*- The bug I had with fscanf is gone. I read on the internet that it
> was a problem with 2.1.52 (and later)
>
> -*- opening octave from the command line still loads octave 2.1.53
>
> -*- the statement if(charc == '\n') is no longer true if charc is
> indeed a newline (see code below, \n is now read as 2 characters)
>
> -*- I now get warnings on any string definition like:
>

Followup to my own mail:

I encountered that even functions like plot produced screens full of
warnings.

I then restarted octave and all the bugs were gone.

I don't know what is wrong. Maybe I still used some old settings file.

I use a PowerPC Mac 10.3.9 by the way.

regards.


Steven Verstoep

_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

Re: warnings which don't help user to undesrtand where the problem is

by Ben Abbott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jan 6, 2009, at 5:09 AM, Steven Verstoep wrote:

>
>>
>> On Jan 5, 2009, at 8:43 AM, bugs_bunny wrote:
>>
>>> I use GNU Octave, version 2.1.53 (powerpc-apple-darwin7.2.0). I  
>>> checked for
>>> updates, but there were no packages to install.
>>
>> There is certainly an update. The current release is 3.0.3.
>>
>> How did you check for an update? Are you running Fink or Darwin/
>> MacPorts?
>>
>> If not, follow the link below and install the Ocave.app from  
>> Sourceforge.
>>
>> http://sourceforge.net/project/showfiles.php?group_id=2888&package_id=237839
>>
>> Ben
>>
>
> I use Fink 0.23.6:

As you are running 10.3.9, you have a rather substantial problem. Fink  
no longer supports 10.3.x :-(

> [domain:~] user% fink update octave
> Password:
> Information about 2072 packages read in 8 seconds.
> No packages to install.
> [domain:~] user%

You should first do a "fink selfupdate" and then "update octave" ...  
however, I do not think it will change anything, as 10.3.x is no  
longer supported.

> I have downloaded octave 3.0.3 but that only makes things worse.

How did you download and install octave?

> -*- The bug I had with fscanf is gone. I read on the internet that  
> it was a problem with 2.1.52 (and later)
>
> -*- opening octave from the command line still loads octave 2.1.53

This is the Fink version. If you downloaded the binary version from  
sourceforge, you'll need to double click on it's icon to run it (I do  
not know if it runs on Mac OSX 10.3.x).

> -*- the statement if(charc == '\n') is no longer true if charc is  
> indeed a newline (see code below, \n is now read as 2 characters)

Since 2.1.53 Octave's maintainers have been improving compatibilty  
with Matlab. To get the functionality you want use char(10) or  
"\n" ... i.e. single-quotes and double-quotes have different meanings  
in Octave. The single-quotes work in a compatible manner.

> -*- I now get warnings on any string definition like:


This I do not see. Perhaps there are some settings in your octaverc  
file that produce these warnings.

Ben


_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave

Re: warnings which don't help user to undesrtand where the problem is

by Thomas Treichl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ben Abbott schrieb:
>> -*- The bug I had with fscanf is gone. I read on the internet that  
>> it was a problem with 2.1.52 (and later)
>>
>> -*- opening octave from the command line still loads octave 2.1.53
>
> This is the Fink version. If you downloaded the binary version from  
> sourceforge, you'll need to double click on it's icon to run it (I do  
> not know if it runs on Mac OSX 10.3.x).

Recent Octave.app releases do not work anymore with G3 processor configurations
(I think the last one that did work with G3 was Octave.app 2.9.14 which also is
still available at the octave.sourceforge.net website), but Octave.app 3.0.3
still works with 10.3.9 systems that at least have a PPC G4 processor.

   Thomas


_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www-old.cae.wisc.edu/mailman/listinfo/bug-octave