bugGNU Octave - Bugs: bug #60471, clang-12 error: unknown type name...

 
 

bug #60471: clang-12 error: unknown type name 'size_t'

Submitter:  Dmitri A. Sergatskov <dasergatskov>
Submitted:  Thu 29 Apr 2021 12:50:29 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 6.2.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 13 May 2021 06:54:34 AM UTC, comment #7: 

The Fedora builder for the stable branch using clang seems to be happy with these changes.

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Thu 13 May 2021 03:19:10 AM UTC, comment #6: 

Fedora's clang buildbots are running clang-12.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 13 May 2021 03:13:37 AM UTC, comment #5: 

I found more instances of unqualified "size_t" on the stable branch.  I changed those to "std::size_t" in this cset: http://hg.savannah.gnu.org/hgweb/octave/rev/7f5bd197fea6.

Someone with clang should check that the stable branch now compiles correctly.

Rik <rik5>
Group administrator
Wed 12 May 2021 05:32:25 PM UTC, comment #4: 

I grafted the changeset to stable here:
https://hg.savannah.gnu.org/hgweb/octave/rev/d13d090cb03a

Like Rik already wrote, there were a bunch of conflicts. I hope I resolved them correctly.

I just grafted the changeset from default to stable. I didn't check if there were any instances of "size_t" or "ptrdiff_t" on stable that were removed on default.
If there are, we should fix those on stable in a follow up change.

Markus Mützel <mmuetzel>
Group administrator
Sun 02 May 2021 02:39:55 PM UTC, comment #3: 

'hg graft' doesn't work cleanly.  I could do a general search&replace with a regular expression, but I'll let jwe weigh in.  He may already have a script to do this.

Rik <rik5>
Group administrator
Fri 30 Apr 2021 06:55:44 PM UTC, comment #2: 

Could you make the sane change on stable?

http://buildbot.octave.org:8010/#/builders/30/builds/282/steps/6/logs/stdio


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 29 Apr 2021 04:04:18 AM UTC, comment #1: 

I pushed the following change to use std::size_t and std::ptrdiff_t consistently in C++ source files:

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

John W. Eaton <jwe>
Group administrator
Thu 29 Apr 2021 12:50:29 AM UTC, original submission:  

clang-12 wants std::size_t instead of size_t in action-container.cc
and action-container.h
If I change as it suggests, code compiles.


libtool: compile:  clang++ -DHAVE_CONFIG_H -I. -I.. -DOCTAVE_DLL -DEXTERNAL_DLL -Iliboctave -I../liboctave -I../liboctave/array -Iliboctave/numeric -I../liboctave/numeric -Iliboctave/operators -I../liboctave/operators -I../liboctave/system -I../liboctave/util -I../liboctave/wrappers -fPIC -pthread -fopenmp -Wall -W -Wshadow -Woverloaded-virtual -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -fvisibility=hidden -g -O2 -MT liboctave/util/libutil_la-action-container.lo -MD -MP -MF liboctave/util/.deps/libutil_la-action-container.Tpo -c ../liboctave/util/action-container.cc  -fPIC -DPIC -o liboctave/util/.libs/libutil_la-action-container.o
In file included from ../liboctave/util/action-container.cc:30:
../liboctave/util/action-container.h:199:26: error: unknown type name 'size_t'; did you mean 'std::size_t'?
    OCTAVE_API void run (size_t num);
                         ^~~~~~
                         std::size_t
/usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/x86_64-redhat-linux/bits/c++config.h:2427:26: note: 'std::size_t' declared here
  typedef __SIZE_TYPE__         size_t;
                                ^
In file included from ../liboctave/util/action-container.cc:30:
../liboctave/util/action-container.h:205:19: error: unknown type name 'size_t'; did you mean 'std::size_t'?
    void discard (size_t num)
                  ^~~~~~
                  std::size_t
/usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/x86_64-redhat-linux/bits/c++config.h:2427:26: note: 'std::size_t' declared here
  typedef __SIZE_TYPE__         size_t;
                                ^
In file included from ../liboctave/util/action-container.cc:30:
../liboctave/util/action-container.h:216:13: error: unknown type name 'size_t'; did you mean 'std::size_t'?
    virtual size_t size (void) const = 0;
            ^~~~~~
            std::size_t
/usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/x86_64-redhat-linux/bits/c++config.h:2427:26: note: 'std::size_t' declared here
  typedef __SIZE_TYPE__         size_t;
                                ^
In file included from ../liboctave/util/action-container.cc:30:
../liboctave/util/action-container.h:210:12: error: unknown type name 'size_t'; did you mean 'std::size_t'?
      for (size_t i = 0; i < num; i++)
           ^~~~~~
           std::size_t
/usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/x86_64-redhat-linux/bits/c++config.h:2427:26: note: 'std::size_t' declared here
  typedef __SIZE_TYPE__         size_t;


Dmitri A. Sergatskov <dasergatskov>

 

(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 mmuetzel (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by dasergatskov (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-05-13 mmuetzel StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2021-05-12 mmuetzel CategoryNone Interpreter
        Item GroupNone Build Failure
        Releasedev 6.2.0
        Operating SystemGNU/Linux Any
    2021-04-29 jwe StatusNone Ready For Test

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code