taskGNU Octave - Tasks: task #14501, Review #include declarations in...


You are not allowed to post comments on this tracker with your current authentication level.

task #14501: Review #include declarations in code base

Submitted by:  Rik <rik5>
Submitted on:  Tue 02 May 2017 05:11:17 PM UTC  
Should Start On: Tue 02 May 2017 07:00:00 AM UTCShould be Finished on: Tue 01 Aug 2017 07:00:00 AM UTC
Category: WishPriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: OpenFixed Release: None
Planned Release: None

Thu 11 May 2017 06:22:12 PM UTC, comment #3:

Unfortunately, it wasn't very automated.


1) make clean
2) make -j1
2a) Use Ctrl+C to stop compilation after gnulib (first target in SUBDIRS) has been built
3) Run make, but substitute include-what-you-use for the actual C++ compiler

4) Postprocess inc.log to extract the interesting bits. I used this Perl script.

5) Further postprocess the include list to remove the repeated elements. I used this Perl script.

As you can see, not that easy.

Rik <rik5>
Project Administrator
Thu 11 May 2017 05:53:25 PM UTC, comment #2:

Could you show how you generated that list? Is it something that can be added as a Makefile target?

John W. Eaton <jwe>
Project Administrator
Tue 09 May 2017 03:49:05 PM UTC, comment #1:

I rationalized the #includes in the liboctave/numeric directory. See this cset http://hg.savannah.gnu.org/hgweb/octave/rev/d691ed308237.

The new, reduced list of #includes for review is attached.

(file #40631)

Rik <rik5>
Project Administrator
Tue 02 May 2017 05:11:17 PM UTC, original submission:

I ran include-what-you-use on the Octave code base to get an idea of which declarations are unnecessary and where we are in fact missing declarations.

The tool is very much imperfect, but I can see there are some problems that could be corrected. Unfortunately, this will require manual review of the results. For instance, the tool completely misunderstands that config.h is always included and by extension oct-conf-post.h is also included. The suggestion to remove config.h and add oct-conf-post.h should be ignored.

Because this is such a big job I am uploading the log file and asking that anyone who has free time tackle a few files. Only by dividing up the work can it all get done.

For reference, the Octave coding guidelines are that the order of includes is

Within each category the headers are alphabetized.

As an example, here is the list for libinterp/corefcn/__delaunayn__.cc

Rik <rik5>
Project Administrator


Attached Files
file #40631:  include.list added by rik5 (2MiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by rik5 (Submitted the item)

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

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 09 May 2017 03:49:05 PM UTCrik5Attached File-=>Added include.list, #40631

    Back to the top

    Powered by Savane 3.1-cleanup1