bugGNU Octave - Bugs: bug #51888, scanf / fscanf / sscanf should be...

 
 

bug #51888: scanf / fscanf / sscanf should be able to return int64 / unit64 values

Submitter:  Mike Miller <mtmiller>
Submitted:  Tue 29 Aug 2017 06:16:58 PM UTC
   
 
Category:  Octave Function Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 13 Dec 2022 05:35:32 AM UTC, comment #2: 

Return oddly close seem

Anonymous
Thu 07 Sep 2017 07:53:06 PM UTC, comment #1: 

I got something working for the scanf(..., "C") case, but I wondered if we should make it always return integer types for any integer conversion?

For the non-C form we have to remain Matlab compatible, but for the C form, scanf returns a cell array so we could return whatever types we want.

Mike Miller <mtmiller>
Group Member
Tue 29 Aug 2017 06:16:58 PM UTC, original submission:  

According to Matlab's docs for fscanf and sscanf, if the format string conversions are all signed 64-bit integer conversions ("%ld" or "%li"), then the return value should be a int64-valued array. If the format string is entirely unsigned 64-bit conversions ("%lo", "%lu", or "%lx"), then the return value should be a uint64-valued array.

This was discussed and confirmed in bug #47741, but a new bug was never filed for this remaining outstanding compatibility issue.

We might want to extend this to also cover the Octave scanf extension using the "C" option, which uses a different code base for its conversions.

Mike Miller <mtmiller>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only group members can vote.

 

Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2019-02-26 mtmiller Carbon-CopyRemoved 80942 -

Back to the top

Powered by Savane 3.12.
Corresponding source code