bugGNU roff - Bugs: bug #52463, anything that talks to standard...

 
 

bug #52463: anything that talks to standard error should identify itself

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Mon 20 Nov 2017 04:26:45 AM UTC
   
 
Category:  General Severity:  2 - Minor
Item Group:  Warning/Suspicious behaviour Status:  In Progress
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 10 Jul 2023 08:43:08 AM UTC, comment #6: 


commit 8b8c997c542a39b4279ede0761372c4fdf7490db
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Fri Apr 7 19:30:43 2023 -0500

    [eqn]: Recast generated diagnostics.

    * src/preproc/eqn/main.cpp (main): Prefix generated *roff diagnostics
      with name of input file (the document).  Use `tmc`/`tm1` to coalesce
      multi-line diagnostic onto one line of output to stderr.  Tighten
      wording.  Continues the long process of fixing Savannah #52463.

    Also reflow long source lines.


G. Branden Robinson <gbranden>
Group administrator
Tue 06 Sep 2022 09:38:33 PM UTC, comment #5: 

Bug #57611 notes that the mdoc package needs to be done.

G. Branden Robinson <gbranden>
Group administrator
Tue 07 Jun 2022 02:39:47 AM UTC, comment #4: 


2022-06-04  G. Branden Robinson <g.branden.robinson@gmail.com>

        * src/devices/gropdf/gropdf.pl: Revise diagnostic message
        handling.
        (top level): Add new scalar `progname` to house executable name.
        (Msg): Output messages in format recommended by GNU Coding
        Standards manual.  Identify who's talking (Savannah #52463).
        Rename `lev` scalar to `fatal` since it is used only as a
        Boolean for immediately exiting with failure status.  Report
        diagnostic severity as part of message.
        (Warn, Die): Add new subroutines through which all diagnostics
        are now emitted.
        (top level): Migrate a use of Perl `die` builtin to our `Die`.
        (top level, ToPoints, LoadDownload, LoadDesc, do_x, GetPoints,
        LoadSWF, LoadPDF, LoadStream, BuildStream, ParsePDFHash,
        LoadFont, GetType1, GetChunk, RemapChr, do_N): Migrate `Msg(0,
        ...)` calls to `Warn` and `Msg(1, ...)` to `Die`.  Begin
        messages in lowercase (GNU Coding Standards).  Recast a few
        messages for clarity.

        Continues the long process of fixing Savannah #52463.


G. Branden Robinson <gbranden>
Group administrator
Wed 02 Mar 2022 10:17:26 AM UTC, comment #3: 


commit f67c5e59582f4b9c19d2a8140be373d1676ca355
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sat Feb 26 22:47:13 2022 +1100

    [xtotroff]: Trivially refactor.

    * src/utils/xtotroff/xtotroff.c: Boolify.  Include `stdbool.h` and
      `errno.h` headers.

      (charExists, CanonicalizeFontName, FontNamesAmbiguous, MapFont):
      Boolify.  Demote return type from `int` to `bool` and return Boolean
      instead of integer literals.

      (FontNamesAmbiguous, main): Reorder equality comparisons with simple
      left-hand sides to avoid inadvertent lvalue assignments.

      (FontNamesAmbiguous, MapFont): Refer to font name as "invalid", not
      "bad", in diagnostic messages.

      (MapFont, main): Use `strerror()` instead of `perror()` so that
      diagnostics include the program name and an indication of problem
      severity.

      (MapFont): Compare `FILE` stream pointer to `NULL` instead of treating
      it as a Boolean.

      (main): Use `EXIT_SUCCESS` and `EXIT_FAILURE` constants from C library
      instead of integer literals for exit status.

    The strerror() bit continues the long process of fixing Savannah #52463.


G. Branden Robinson <gbranden>
Group administrator
Wed 02 Mar 2022 10:15:48 AM UTC, comment #2: 


commit 1f7b8bf097cb5cf8327c7d6f083e8f2195cf0b2d
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed Feb 23 01:51:35 2022 +1100

    tmac/pdf.tmac: Identify self in diagnostics.

    * tmac/pdf.tmac: Add string containing the name of the macro package for
      use in diagnostic messages.

      (pdf:warn, pdf:error): Use it.

    Continues the long process of fixing Savannah #52463.


G. Branden Robinson <gbranden>
Group administrator
Tue 25 Jan 2022 04:39:16 PM UTC, comment #1: 

This isn't done, but it is wearing down like a block of Azbantium.


commit 6a7b821acfc0329db5e08cf011a88c8d87280f29
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed Dec 8 09:24:52 2021 +1100

    [me]: Revise diagnostic messages.

    ...to follow GNU Coding Standards, identifying what is emitting them.

    * tmac/e.tmac (_e): New string holds "e.tmac".

      (@err): New macro constructs and issues diagnostics.  Add file name to
      messages when available.  Suppress line number when unavailable.

      (check_page_length, @z, @h, n2, sk, @p, @(, @), (c, )c, EQ, (f, ++,
      @U): Call `@err` instead of invoking `tm` request.  Revise wording of
      messages in an attempt at clarity.

    Continues the long process of fixing Savannah #52463.

commit dcc38ebd122864a66aa23ba8f0e1bf468a0c5344
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sun May 30 11:18:40 2021 +1000

    tmac/papersize.tmac: Improve diagnostic message.

    * tmac/papersize.tmac: Improve diagnostic message; when complaining
      about unrecognized input, report back the input we actually received,
      not what it looks like after we transform it.  Also add name of macro
      package to diagnostic so the user knows who is speaking, continuing
      the long process of fixing Savannah #52463.

commit 7dcb6263dcb3edcf373fff0a6e1f62242d18950e
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sun May 23 13:01:52 2021 +1000

    [grohtml]: Avoid deallocation of static strings.

    * src/devices/grohtml/post-html.cpp (assert_state::add): Avoid potential
      deallocation of statically-allocated strings.  Use strsave() to
      duplicate them so that they can be safely handed to a_delete().  Also
      update diagnostic message to report name of complaining program
      (continuing the long process of fixing Savannah #52463).

    Fixes <https://savannah.gnu.org/bugs/index.php?60656>.  Thanks to
    Petru-Florin Mihancea for the report.

    Also wrap source lines at 72 columns.

commit 5ceb0eee6676ebed0836f884ba5e3769c24b80d9
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sat May 22 18:14:51 2021 +1000

    [grohtml]: Use warning() upon usage errors.

    * src/preproc/html/pre-html.cpp (scanArguments):
    * src/devices/grohtml/post-html.cpp (main): Use libgroff's warning()
      instead of printf() to emit diagnostic about unrecognized paramter to
      `-x` option.  This sends the diagnostic to the standard error stream
      and continues the long process of fixing Savannah #52463.

commit 546748d60c95886e408c07083d60cc06516aed5c
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed Jan 20 18:23:20 2021 +1100

    [grog]: Report program name in fatal diagnostics.

    * src/roff/grog/grog.pl: Report program name in fatal error diagnostics.
      Also drop sentence-ending punctuation since Perl supplies additional
      information.

    Continues the long process of fixing Savannah #52463.

commit ac0dc2068bd8cb5a7ef84c0659698da0306cba65
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Fri Oct 30 23:00:35 2020 +1100

    tmac/s.tmac: Revise diagnostic messages.

    Define a common prefix string, starting all such messages with "s.tmac".
    Continues the long process of fixing Savannah #52463.  Drop the word
    "macro" from diagnostic since this will now be clear from the prefix.
    Prefix every macro name in a diagnostic message with a leading dot; this
    was already done in four cases.

    (cov*first-page-init): Use temporary string to avoid multi-line
    diagnostic message.

    (@NH): Use temporary string to prevent overlength line.

    A further benefit of this revision is that index information produced by
    ms's .IX macro (which writes to the standard error stream) will now be
    trivially easy to extract even for documents that cause diagnostic
    messages.  One can simply filter them with
            grep -v '^s\.tmac:'
    or similar.

    Also wrap long lines and comment some unimplemented macros.

commit 3b680c8500ccca576c95253009e28764c36e9cd2
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sat Oct 17 10:06:11 2020 +1100

    [afmtodit]: Report program name in warnings.

    * src/utils/afmtodit/afmtodit.pl: Report program name in warning
      diagnostics.

    Continues the long process of fixing Savannah #52463.

commit f75e156b621d3743368c58425f357e6cd52372a0
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sat Sep 26 10:41:29 2020 +1000

    src/preproc/tbl/table.cpp: Regularize diagnostics.

    * src/preproc/tbl/table.cpp (table::init_output):
      (table::compute_expand_width):
      (table::compute_separation_factor): Use consistent format for
      diagnostic messages.
      + Do not spread a single diagnostic across multiple lines.
      + Report messages in GNU Coding Standards format, that is:
      + Report the name of the file the problem is in...
      + ...then the line number...
      + ...then the diagnostic severity level...
      + ...then the specific problem.

    Unfortunately source line numbers for tbl(1) tables can get a bit
    approximate and are badly off in some cases (I think it has to do with
    text blocks--I'll be investgating that soon), but that is a separate
    issue.

    Continues the long process of fixing Savannah #52463.

    Here are examples of output before and after this change. \\ marks lines
    wrapped for the purpose of this commit message.

    Before:

    $ groff -z -Tps -t -ms diag1-Tps.ms
    warning: file 'diag1-Tps.ms', around line 11:
      table wider than line width
    warning: file 'diag1-Tps.ms', around line 11:
      column separation set to zero
    warning: file 'diag1-Tps.ms', around line 101:
      table wider than line width
    warning: file 'diag1-Tps.ms', around line 96:
      table squeezed horizontally to fit line length
    $ groff -z -Tps -t -man diag2-Tps.man
    error: page 2: table will not fit on one page; use .TS H/.TH with a \\
    supporting macro package
    $ groff -z -Tutf8 -t -man diag3-Tutf8.man
    warning: page 3: table text block will not fit on one page
    warning: page 10: table text block will not fit on one page

    Now:

    $ ../build/test-groff -z -Tps -t -ms diag1-Tps.ms
    diag1-Tps.ms: around line 11: warning: table wider than line width
    diag1-Tps.ms: around line 11: warning: column separation set to zero
    diag1-Tps.ms: around line 101: warning: table wider than line width
    diag1-Tps.ms: around line 96: warning: table squeezed horizontally to \\
    fit line length
    $ ../build/test-groff -z -Tps -t -man diag2-Tps.man
    diag2-Tps.man: around line 3660: error: table will not fit on page 2; \\
    use .TS H/.TH with a supporting macro package
    $ ../build/test-groff -z -Tutf8 -t -man diag3-Tutf8.man
    diag3-Tutf8.man: around line 536: warning: table text block will not \\
    fit on page 3
    diag3-Tutf8.man: around line 1361: warning: table text block will not \\
    fit on page 10

commit a2058f6ba364144d193262f4efae8941c47c7fa1
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sun Nov 4 13:54:00 2018 -0500

    an-old.tmac: Report macro file in diagnostics.

            * tmac/an-old.tmac: When emitting diagnostics, report the name
            of the macro file complaining.

            Continues the long process of fixing
            <https://savannah.gnu.org/bugs/?52463>.

            Also:
            + Shorten abort diagnostic when version of groff is too old, to
              keep input line length within 72 columns.

    Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com>

commit 697beedb7a27c6205fe939d51a490c510cbebe6a
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Thu Nov 30 13:27:57 2017 -0500

    Make writers to stderr identify themselves.

    * font/devpdf/util/BuildFoundries.pl:
    Same; also refactor all diagnostics into Notice(), Warn(), and Die()
    functions, which delegate their common message-printing to Msg().

    Fix part of bug https://savannah.gnu.org/bugs/?52463.

    Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com>


G. Branden Robinson <gbranden>
Group administrator
Mon 20 Nov 2017 04:26:45 AM UTC, original submission:  

Many parts of groff (especially preprocessors and macro packages) emit diagnostics to standard error without identifying where they are coming from.

As groff lends itself to deep pipelines and is an interpreted, extensible language on top of that, it's frustrating to not know which part of the system is barking at me when there is a problem.

I propose to make all tools and macro packages identify themselves when writing to stderr or using .ab, .tm, etc., if they do not already.

G. Branden Robinson <gbranden>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bgarrigues (Updated the item)
  • -email is unavailable- added by gbranden (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-09 gbranden Dependencies- Depends on bugs #57611
    2022-09-06 gbranden Severity3 - Normal 2 - Minor
        Item GroupFeature change Warning/Suspicious behaviour
    2022-01-25 gbranden CategoryNone General
    2018-11-26 bgarrigues Severity1 - Wish 3 - Normal
    2018-11-05 gbranden StatusNone In Progress

    Back to the top

    Powered by Savane 3.13-04b1.
    Corresponding source code