bugGNU roff - Bugs: bug #63079, #include <assert.h> or...

 
 

bug #63079: #include <assert.h> or "assert.h" ?

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Sun 18 Sep 2022 08:56:54 PM UTC
   
 
Category:  General Severity:  2 - Minor
Item Group:  Lint Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 25 Sep 2022 09:06:47 PM UTC, comment #2: 


commit 91280c1748c5f008f72684ccf50cdaa3ee77726f
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Mon Sep 19 15:16:16 2022 -0500

    [grodvi, ...]: Trivially refactor.

    Tidy up #includes of the "assert.h" header, which we locally provide to
    ensure a C99-conformant implementation.  Drop inclusion of header from
    files that don't directly need it, add it where they do, and spell the
    inclusion consistently with double quotes to cue the reader of its local
    status.

    * src/devices/grodvi/dvi.cpp:
    * src/devices/grolj4/lj4.cpp:
    * src/libs/libdriver/printer.cpp:
    * src/preproc/eqn/box.cpp:
    * src/preproc/eqn/delim.cpp:
    * src/preproc/eqn/pile.cpp:
    * src/preproc/eqn/script.cpp: Add inclusion.

    * src/include/driver.h:
    * src/libs/libgroff/fontfile.cpp:
    * src/preproc/eqn/eqn.h:
    * src/preproc/html/pushback.cpp:
    * src/preproc/refer/refer.h:
    * src/preproc/tbl/table.h:
    * src/utils/addftinfo/addftinfo.cpp: Drop inclusion.

    * src/include/itable.h:
    * src/include/stringclass.h:
    * src/libs/libbib/linear.cpp:
    * src/libs/libbib/search.cpp:
    * src/libs/libgroff/color.cpp:
    * src/libs/libgroff/font.cpp:
    * src/libs/libgroff/nametoindex.cpp:
    * src/libs/libgroff/prime.cpp:
    * src/libs/libgroff/searchpath.cpp:
    * src/preproc/html/pre-html.cpp:
    * src/preproc/preconv/preconv.cpp:
    * src/preproc/soelim/soelim.cpp:
    * src/utils/indxbib/indxbib.cpp:
    * src/utils/lkbib/lkbib.cpp:
    * src/utils/lookbib/lookbib.cpp: Respell inclusion.

    Fixes <https://savannah.gnu.org/bugs/?63079>.  Thanks to Bjarni Ingi
    Gislason for the report.

    Also annotate our assert.h to indicate why it's there.

    Also update editor aid comments and drop old style Emacs file-local
    variable setting.


G. Branden Robinson <gbranden>
Group administrator
Mon 19 Sep 2022 07:53:25 PM UTC, comment #1: 

original submission:

> Subject: #include <assert.h> or "assert.h" ?
>
>   Some source files use '<assert.h>' and others '"assert.h"'.


I acknowledge the inconsistency.  However, on my system, neither choice seems to prevent groff's assert.h from being located in preference to the standard C library's.

Verifying this is straightforward: add a telltale string literal to the assert() macro expansion and contrive an assertion failure, for instance in src/roff/troff/input.cpp.

>   It should at least be documented in the file why the '"assert.h"' is used


Okay.  I can put a sentence from the commit message into a comment.

> and where that file exactly is.


This, I decline to do.  In the event the source tree should be reorganized such that our "assert.h" moves, annotating its location just creates more places that the notation can become invalid.

I expect even a novice developer to be capable of running "find -name assert.h", or of using something like cscope, or of using a fancy IDE like Atom that crawls the whole source tree and creates a navigation pane.  (So, cscope reinvented in JavaScript and praised for its thoroughly unprecedented innovation.  :-| )
 

> See also bug #63078.


That still looks to me like a consequence of a poorly managed working copy.

G. Branden Robinson <gbranden>
Group administrator
Sun 18 Sep 2022 08:56:54 PM UTC, original submission:  

Subject: #include <assert.h> or "assert.h" ?

  Some source files use '<assert.h>' and others '"assert.h"'.

  It should at least be documented in the file why the '"assert.h"' is
used and where that file exactly is.

See also bug #63078.

Bjarni Ingi Gislason <bjarniig>

 

(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 gbranden (Posted a comment)
  • -email is unavailable- added by bjarniig (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 logged-in users can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-09-25 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2022-09-19 gbranden Severity3 - Normal 2 - Minor
        Item GroupDocumentation Lint
        StatusNone In Progress
        Assigned toNone gbranden
        Planned ReleaseNone 1.23.0

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code