public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH/RFC 0/4] C/C++/diagnostics: various UX improvements
@ 2023-11-02 13:19 David Malcolm
  2023-11-02 13:19 ` [PATCH 1/4] c/c++: rework pragma parsing David Malcolm
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: David Malcolm @ 2023-11-02 13:19 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Malcolm

The following patch kit implements the:
  #pragma GCC show_layout (struct foo)
idea I mentioned in my Cauldron talk (in patch 2),  and the other
patches implement various related user experience changes I came
across when implementing it.

Patch 1 reworks how c-pragma.cc parses pragmas, and experiments with
adding links to documentation to the diagnostics messages (on a
suitably capable terminal).

Patch 2 implements the new "show_layout" pragma

Patch 3 adds a new mechanism to the diagnostics subsytem for
automatically adding documentation links to messages, with enough
data to handle the pragmas from patch 1.

Patch 4 attempts to automatically populate the URL data for our docs by
parsing the results of "make html".

Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.

I'd like to go ahead with patch 1 and patch 3; patch 2 and patch 4 may
need more work, but posting here for feedback.

Thoughts?

David Malcolm (4):
  c/c++: rework pragma parsing
  c: add #pragma GCC show_layout
  diagnostics: add automatic URL-ification within messages
  RFC: add contrib/regenerate-index-urls.py

 contrib/regenerate-index-urls.py              |  245 ++
 gcc/Makefile.in                               |    3 +-
 gcc/analyzer/record-layout.cc                 |  235 ++
 gcc/analyzer/record-layout.h                  |    4 +
 gcc/c-family/c-pragma.cc                      |  641 ++++-
 gcc/c-family/c-pragma.h                       |    5 +-
 gcc/diagnostic.cc                             |    8 +-
 gcc/diagnostic.h                              |    4 +
 gcc/doc/extend.texi                           |   49 +
 gcc/gcc-urlifier.cc                           |  159 ++
 gcc/gcc-urlifier.def                          | 2532 +++++++++++++++++
 gcc/gcc-urlifier.h                            |   26 +
 gcc/gcc.cc                                    |    2 +
 gcc/pretty-print-urlifier.h                   |   33 +
 gcc/pretty-print.cc                           |  242 +-
 gcc/pretty-print.h                            |    5 +-
 gcc/selftest-run-tests.cc                     |    1 +
 gcc/selftest.h                                |    1 +
 gcc/stor-layout.h                             |    3 +
 .../c-c++-common/pragma-message-parsing.c     |   21 +
 .../c-c++-common/pragma-optimize-parsing.c    |   16 +
 .../c-c++-common/pragma-pack-parsing-1.c      |   19 +
 .../c-c++-common/pragma-pack-parsing-2.c      |    4 +
 .../pragma-redefine_extname-parsing.c         |    9 +
 .../c-c++-common/pragma-target-parsing.c      |   14 +
 .../c-c++-common/pragma-visibility-parsing.c  |   13 +
 .../c-c++-common/pragma-weak-parsing.c        |   24 +
 gcc/testsuite/gcc.dg/bad-pragma-locations.c   |   22 +-
 .../gcc.dg/parsing-pragma-show_layout.c       |   15 +
 .../pragma-scalar_storate_order-parsing.c     |    8 +
 gcc/testsuite/gcc.dg/pragma-show_layout-1.c   |   12 +
 gcc/testsuite/gcc.dg/pragma-show_layout-2.c   |  184 ++
 ...agma-show_layout-infoleak-CVE-2017-18550.c |  175 ++
 gcc/testsuite/gcc.dg/sso-6.c                  |    2 +-
 gcc/toplev.cc                                 |    2 +
 35 files changed, 4589 insertions(+), 149 deletions(-)
 create mode 100755 contrib/regenerate-index-urls.py
 create mode 100644 gcc/gcc-urlifier.cc
 create mode 100644 gcc/gcc-urlifier.def
 create mode 100644 gcc/gcc-urlifier.h
 create mode 100644 gcc/pretty-print-urlifier.h
 create mode 100644 gcc/testsuite/c-c++-common/pragma-message-parsing.c
 create mode 100644 gcc/testsuite/c-c++-common/pragma-optimize-parsing.c
 create mode 100644 gcc/testsuite/c-c++-common/pragma-pack-parsing-1.c
 create mode 100644 gcc/testsuite/c-c++-common/pragma-pack-parsing-2.c
 create mode 100644 gcc/testsuite/c-c++-common/pragma-redefine_extname-parsing.c
 create mode 100644 gcc/testsuite/c-c++-common/pragma-target-parsing.c
 create mode 100644 gcc/testsuite/c-c++-common/pragma-visibility-parsing.c
 create mode 100644 gcc/testsuite/c-c++-common/pragma-weak-parsing.c
 create mode 100644 gcc/testsuite/gcc.dg/parsing-pragma-show_layout.c
 create mode 100644 gcc/testsuite/gcc.dg/pragma-scalar_storate_order-parsing.c
 create mode 100644 gcc/testsuite/gcc.dg/pragma-show_layout-1.c
 create mode 100644 gcc/testsuite/gcc.dg/pragma-show_layout-2.c
 create mode 100644 gcc/testsuite/gcc.dg/pragma-show_layout-infoleak-CVE-2017-18550.c

-- 
2.26.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-11-04  2:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-02 13:19 [PATCH/RFC 0/4] C/C++/diagnostics: various UX improvements David Malcolm
2023-11-02 13:19 ` [PATCH 1/4] c/c++: rework pragma parsing David Malcolm
2023-11-02 13:19 ` [PATCH 2/4] c: add #pragma GCC show_layout David Malcolm
2023-11-02 13:19 ` [PATCH 3/4] diagnostics: add automatic URL-ification within messages David Malcolm
2023-11-04  1:59   ` [pushed] " David Malcolm
2023-11-02 13:19 ` [PATCH 4/4] RFC: add contrib/regenerate-index-urls.py David Malcolm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).