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

 
 

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

Submitted by:  Dmitri A. Sergatskov <dasergatskov>
Submitted on:  Thu 29 Apr 2021 12:50:29 AM UTC  
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Ready For Test Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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>
Project 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 rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by dasergatskov (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-04-29 jwe StatusNone => Ready For Test

    Back to the top


    Powered by Savane 3.6