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

Steven Verstoep isgoed at hotmail.com
Tue Jan 6 04:09:23 CST 2009




>
> 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



More information about the Bug-octave mailing list