octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55046] Add static compile-time checking of pr


From: Rik
Subject: [Octave-bug-tracker] [bug #55046] Add static compile-time checking of printf functions using compiler attributes
Date: Thu, 29 Nov 2018 11:46:22 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063

Follow-up Comment #18, bug #55046 (project octave):

I think there is a bit more work cleaning up the new warnings that have been
generated.

When compiling I now get these warning (also attached as a file)


libinterp/dldfcn/__eigs__.cc:606:79: warning: format ‘%d’ expects argument
of type ‘int’, but argument 3 has type ‘octave_idx_type {aka long
int}’ [-Wformat=]
libinterp/dldfcn/__eigs__.cc:610:30: warning: format ‘%d’ expects argument
of type ‘int’, but argument 3 has type ‘octave_idx_type {aka long
int}’ [-Wformat=]
libinterp/dldfcn/__eigs__.cc:610:30: warning: format ‘%d’ expects argument
of type ‘int’, but argument 4 has type ‘octave_idx_type {aka long
int}’ [-Wformat=]
libinterp/dldfcn/convhulln.cc:256:66: warning: format ‘%d’ expects
argument of type ‘int’, but argument 2 has type ‘octave_idx_type {aka
long int}’ [-Wformat=]
         warning ("convhulln: facet %d only has %d vertices", i, j);
libinterp/dldfcn/convhulln.cc:256:66: warning: format ‘%d’ expects
argument of type ‘int’, but argument 3 has type ‘octave_idx_type {aka
long int}’ [-Wformat=]
libinterp/dldfcn/qr.cc:331:70: warning: format ‘%d’ expects argument of
type ‘int’, but argument 2 has type ‘octave_idx_type {aka long int}’
[-Wformat=]
libinterp/dldfcn/qr.cc:331:70: warning: format ‘%d’ expects argument of
type ‘int’, but argument 3 has type ‘octave_idx_type {aka long int}’
[-Wformat=]
libinterp/dldfcn/qr.cc:347:70: warning: format ‘%d’ expects argument of
type ‘int’, but argument 2 has type ‘octave_idx_type {aka long int}’
[-Wformat=]
libinterp/dldfcn/qr.cc:347:70: warning: format ‘%d’ expects argument of
type ‘int’, but argument 3 has type ‘octave_idx_type {aka long int}’
[-Wformat=]
libinterp/dldfcn/symbfact.cc:380:28: warning: format not a string literal and
no format arguments [-Wformat-security]
libgui/graphics/Table.cc:312:45: warning: format not a string literal and no
format arguments [-Wformat-security]
         warning (warn_string.str ().c_str ());
libgui/graphics/Table.cc:554:46: warning: format not a string literal and no
format arguments [-Wformat-security]
       warning (error.string_value ().c_str ());
libinterp/octave-value/ov-java.cc:1941:30: warning: format not a string
literal and no format arguments [-Wformat-security]
libinterp/parse-tree/oct-parse.yy:5688:52: warning: format not a string
literal and no format arguments [-Wformat-security]
libinterp/parse-tree/pt-eval.cc:2399:37: warning: format ‘%d’ expects
argument of type ‘int’, but argument 2 has type ‘octave_idx_type {aka
long int}’ [-Wformat=]
libinterp/parse-tree/pt-eval.cc:2426:79: warning: format ‘%d’ expects
argument of type ‘int’, but argument 2 has type ‘octave_idx_type {aka
long int}’ [-Wformat=]
libinterp/parse-tree/pt-eval.cc:2723:53: warning: format not a string literal
and no format arguments [-Wformat-security]
libinterp/parse-tree/pt-eval.cc:3488:45: warning: format not a string literal
and no format arguments [-Wformat-security]
libinterp/corefcn/__magick_read__.cc:881:38: warning: format ‘%i’ expects
argument of type ‘int’, but argument 2 has type ‘long int’
[-Wformat=]
libinterp/corefcn/__magick_read__.cc:914:21: warning: format ‘%i’ expects
argument of type ‘int’, but argument 2 has type ‘octave_idx_type {aka
long int}’ [-Wformat=]
libinterp/corefcn/cellfun.cc:1881:74: warning: format ‘%d’ expects
argument of type ‘int’, but argument 3 has type ‘octave_idx_type {aka
long int}’ [-Wformat=]
libinterp/corefcn/cellfun.cc:1881:74: warning: format ‘%d’ expects
argument of type ‘int’, but argument 4 has type ‘octave_idx_type {aka
long int}’ [-Wformat=]
libinterp/corefcn/data.cc:2734:71: warning: format ‘%d’ expects argument
of type ‘int’, but argument 2 has type ‘octave_idx_type {aka long
int}’ [-Wformat=]
libinterp/corefcn/data.cc:5480:27: warning: format ‘%d’ expects argument
of type ‘int’, but argument 2 has type ‘octave_idx_type {aka long
int}’ [-Wformat=]
libinterp/corefcn/errwarn.cc:102:24: warning: format ‘%d’ expects argument
of type ‘int’, but argument 2 has type ‘octave_idx_type {aka long
int}’ [-Wformat=]
libinterp/corefcn/errwarn.cc:102:24: warning: format ‘%d’ expects argument
of type ‘int’, but argument 3 has type ‘octave_idx_type {aka long
int}’ [-Wformat=]
libinterp/corefcn/errwarn.cc:102:24: warning: format ‘%d’ expects argument
of type ‘int’, but argument 4 has type ‘octave_idx_type {aka long
int}’ [-Wformat=]
libinterp/corefcn/errwarn.cc:102:24: warning: format ‘%d’ expects argument
of type ‘int’, but argument 5 has type ‘octave_idx_type {aka long
int}’ [-Wformat=]
libinterp/corefcn/ft-text-renderer.cc:73:83: warning: format ‘%x’ expects
argument of type ‘unsigned int’, but argument 3 has type ‘FT_ULong {aka
long unsigned int}’ [-Wformat=]
libinterp/corefcn/ft-text-renderer.cc:80:83: warning: format ‘%x’ expects
argument of type ‘unsigned int’, but argument 3 has type ‘FT_ULong {aka
long unsigned int}’ [-Wformat=]
libinterp/corefcn/graphics.cc:2459:46: warning: format ‘%d’ expects
argument of type ‘int’, but argument 2 has type ‘octave_idx_type {aka
long int}’ [-Wformat=]
libinterp/corefcn/graphics.cc:2459:46: warning: format ‘%d’ expects
argument of type ‘int’, but argument 3 has type ‘octave_idx_type {aka
long int}’ [-Wformat=]
libinterp/corefcn/graphics.cc:12120:63: warning: format ‘%d’ expects
argument of type ‘int’, but argument 2 has type ‘octave_idx_type {aka
long int}’ [-Wformat=]
libinterp/corefcn/graphics.cc:12120:63: warning: format ‘%d’ expects
argument of type ‘int’, but argument 3 has type ‘octave_idx_type {aka
long int}’ [-Wformat=]
libinterp/corefcn/hex2num.cc:71:67: warning: format ‘%d’ expects argument
of type ‘int’, but argument 2 has type ‘size_t {aka long unsigned
int}’ [-Wformat=]
libinterp/corefcn/ls-mat-ascii.cc:332:33: warning: format ‘%d’ expects
argument of type ‘int’, but argument 2 has type ‘octave_idx_type {aka
long int}’ [-Wformat=]
libinterp/corefcn/ls-oct-text.cc:378:52: warning: format ‘%d’ expects
argument of type ‘int’, but argument 2 has type ‘octave_idx_type {aka
long int}’ [-Wformat=]
         warning ("ignoring last %d columns", extras);
libinterp/corefcn/mex.cc:2184:35: warning: format ‘%d’ expects argument of
type ‘int’, but argument 3 has type ‘size_t {aka long unsigned int}’
[-Wformat=]
libinterp/corefcn/oct-stream.cc:2661:37: warning: format ‘%d’ expects
argument of type ‘int’, but argument 4 has type ‘octave_idx_type {aka
long int}’ [-Wformat=]
libinterp/corefcn/sub2ind.cc:134:51: warning: format not a string literal and
no format arguments [-Wformat-security]
libinterp/corefcn/syscalls.cc:293:24: warning: format not a string literal and
no format arguments [-Wformat-security]


I'll take care of the "format not a string literal", but that leaves a large
number of int warnings.  We need a general strategy about those.  I suspect
the issues is that a lot of them are octave_idx_type which can be either
32-bit (int) or 64-bit (long int).  It would be a pain to have to replicate
every warning or error and have an #ifdef to decide based on the size of
octave_idx_type.


(file #45552)
    _______________________________________________________

Additional Item Attachment:

File name: warn.list                      Size:6 KB


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55046>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]