bugGNU Octave - Bugs: bug #54206, Compilation warning on xerbla.c on...

 
 

bug #54206: Compilation warning on xerbla.c on stable branch

Submitter:  Rik <rik5>
Submitted:  Fri 29 Jun 2018 06:55:01 PM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  jwe
Originator Name:  Open/Closed:  * Closed
Release:  * 4.4.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 29 Jun 2018 09:21:05 PM UTC, comment #6: 

LGMT, built with Clang 7 and GCC 8.

Mike Miller <mtmiller>
Group Member
Fri 29 Jun 2018 09:17:06 PM UTC, comment #5: 

It was mean to make jwe do this change when he didn't have a compiler that was producing the warning and could give feedback.  I changed the format code back to %ld for the F77_INT which is cast to long in the printf statement (http://hg.savannah.gnu.org/hgweb/octave/rev/194417044d1a).

Marking as fixed and closing report.

Rik <rik5>
Group administrator
Fri 29 Jun 2018 09:00:45 PM UTC, comment #4: 

No, I now get this warning with Clang 7


../liboctave/external/blas-xtra/xerbla.c:65:12: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
           (long) (*info));
           ^~~~~~~~~~~~~~


I think you shouldn't have dropped the '%ld', the warning message was about the '*' in the '%.*s' format conversion.

Mike Miller <mtmiller>
Group Member
Fri 29 Jun 2018 08:49:50 PM UTC, comment #3: 

I pushed this change on stable and merged with default:

http://hg.savannah.gnu.org/hgweb/octave/rev/c05adc188b98

Is that OK?

John W. Eaton <jwe>
Group administrator
Fri 29 Jun 2018 07:54:58 PM UTC, comment #2: 

I guess I was a little too smart using size_t here.  This string won't be long (usually less than 9 characters), so it is probably fine to use int for the value.

John W. Eaton <jwe>
Group administrator
Fri 29 Jun 2018 07:34:49 PM UTC, comment #1: 

Neat, I get this warning building with Clang 7


../liboctave/external/blas-xtra/xerbla.c:64:23: warning: field precision should have type 'int', but argument has type 'size_t' (aka 'unsigned long') [-Wformat]
  fprintf (stderr, "%.*s: parameter number %ld is invalid\n", slen, s,
                    ~~^~                                      ~~~~
1 warning generated.


but no warning at all with GCC 7.

Mike Miller <mtmiller>
Group Member
Fri 29 Jun 2018 06:55:01 PM UTC, original submission:  

While compiling stable with


parent: 25523:5daeb4049088 tip
 gui: fix editor rendering on some displays, disable QScintilla buffered drawing
branch: stable


I get the following compilation warning.


liboctave/external/blas-xtra/xerbla.c: In function ‘xerbla_’:
liboctave/external/blas-xtra/xerbla.c:64:19: warning: field precision specifier ‘.*’ expects argument of type ‘int’, but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
   fprintf (stderr, "%.*s: parameter number %ld is invalid\n", slen, s,


Seems easy enough to fix, and should be done before 4.4.1 release.

Rik <rik5>
Group administrator

 

(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

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by rik5 (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-06-29 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2018-06-29 mtmiller StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code