bugGNU Octave - Bugs: bug #44162, prepad issues warnings when...

 
 

bug #44162: prepad issues warnings when prepadding strings

Submitter:  None
Submitted:  Mon 02 Feb 2015 08:42:29 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Oliver Heimlich Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 03 Feb 2015 01:37:39 AM UTC, comment #5: 

Fixed on the default branch:

 http://hg.savannah.gnu.org/hgweb/octave/rev/107ec5195a47

Thanks for noticing and providing a patch. I included some simple tests for both prepad and postpad with strings.

Mike Miller <mtmiller>
Group Member
Mon 02 Feb 2015 09:34:33 PM UTC, comment #4: 

And perhaps add some unit tests using strings to ensure this continues to work in the future.

Mike Miller <mtmiller>
Group Member
Mon 02 Feb 2015 09:32:38 PM UTC, comment #3: 

Looks like postpad was fixed as part of the resolution to bug #37785, but not prepad. The same change that was made in http://hg.savannah.gnu.org/hgweb/octave/rev/c8e1b0213e34 should be applied here.

Mike Miller <mtmiller>
Group Member
Mon 02 Feb 2015 09:30:57 PM UTC, comment #2: 

Please see the patch file from the first post. There is no need to disable the warning.

In the history I have found 16304:c8e1b0213e34 (#37785), which did the same fix for the postpad function.

Anonymous
Mon 02 Feb 2015 08:58:35 PM UTC, comment #1: 

Just running "test prepad" confirms this.

Is it a matter of temporarily disabling the warning?

Philip Nienhuis <philipnienhuis>
Group Member
Mon 02 Feb 2015 08:42:29 PM UTC, original submission:  

The prepad function creates a warning when the first parameter is a string. The postpad function creates no such warning. There was no warning in 3.8.2.


octave:1> prepad ("Hello World", 15, "!")
warning: implicit conversion from numeric to char
warning: called from
    prepad at line 83 column 7
ans = !!!!Hello World


Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #32976:  prepad-string-warning.patch added by None (339B - text/x-patch - This patch copies postpad's behaviour in prepad and disables the warning)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    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.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-02-03 mtmiller StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2015-02-02 philipnienhuis StatusNone Confirmed
    2015-02-02 None Attached File- Added prepad-string-warning.patch, #32976

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code